-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c320ba7
commit 334958f
Showing
2 changed files
with
36 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package templates | ||
|
||
var DockerComposePostgres = `version: "3.8" | ||
services: | ||
postgres: | ||
image: postgres:11.5-alpine | ||
container_name: postgres-{{.ServiceName}} | ||
logging: | ||
driver: none | ||
environment: | ||
- POSTGRES_USER={{.User}} | ||
- POSTGRES_PASSWORD={{.Password}} | ||
- POSTGRES_DB={{.DatabaseName}} | ||
ports: | ||
- "{{.Port}}:5432" | ||
` | ||
|
||
var MakefilePostgres = `up: | ||
docker compose up -d | ||
down: | ||
docker compose down | ||
stop: | ||
docker stop postgres-{{.ServiceName}} | ||
id: | ||
docker ps -aqf "name=postgres-{{.ServiceName}}" | awk '{print $1}' | ||
seed: | ||
cat dump.sql | docker exec -i $(c) psql -U {{.User}} -d {{.DatabaseName}} | ||
help: | ||
make -qpRr | egrep -e '^[a-z].*:$$' | sed -e 's~:~~g' | sort | ||
.PHONY: up down stop id seed help | ||
` |