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
dump: | |
@echo [ dumping postgres backup for $(POSTGRES_DB)... ] | |
@docker exec -it db pg_dump --username $(POSTGRES_USER) $(POSTGRES_DB) > ./api/scripts/backup.sql | |
@echo $(SUCCESS) |
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
docker build --target test --tag demo/client:test ./client | |
docker build --target test --tag demo/api:test ./api |
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
dlv debug --accept-multiclient --continue --headless --listen=:2345 --api-version=2 --log ./cmd/api/ |
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
CompileDaemon --build="go build -o main ./cmd/api" --command=./main |
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
#!/bin/bash | |
set -e | |
if [ ! -f "/docker-entrypoint-initdb.d/backup.sql" ]; then | |
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" -- <<-EOSQL | |
CREATE TABLE products ( | |
id serial primary key, | |
name varchar(100) not null, | |
price real not null, |
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
ifeq (,$(findstring postgres-net,$(NETWORKS))) | |
# do something | |
endif |
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
#!make | |
NETWORKS="$(shell docker network ls)" | |
VOLUMES="$(shell docker volume ls)" | |
POSTGRES_DB="$(shell cat ./secrets/postgres_db)" | |
POSTGRES_USER="$(shell cat ./secrets/postgres_user)" | |
POSTGRES_PASSWORD="$(shell cat ./secrets/postgres_passwd)" | |
SUCCESS=[ done "\xE2\x9C\x94" ] | |
# default arguments |
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
client: | |
build: | |
context: ./client | |
target: dev | |
ports: | |
- 3000:3000 | |
volumes: | |
- ./client:/client/app | |
- /client/app/node_modules | |
networks: |
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
- "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)" | |
- "traefik.http.routers.http-catchall.entrypoints=web" | |
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https@docker" | |
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" |
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
traefik: | |
image: traefik:v2.1.2 | |
command: | |
- "--api.insecure=true" # Not For Production | |
- "--api.debug=true" | |
- "--log.level=DEBUG" | |
- "--providers.docker" | |
- "--providers.docker.exposedbydefault=false" | |
- "--providers.docker.network=traefik-public" | |
- "--entrypoints.web.address=:80" |