66 lines
1.3 KiB
YAML
66 lines
1.3 KiB
YAML
services:
|
|
|
|
db:
|
|
image: postgres:16
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- "${PGPORT}:${PGPORT}"
|
|
volumes:
|
|
- postgres-db:/var/lib/postgresql/data
|
|
environment:
|
|
- POSTGRES_USER=${PGUSER}
|
|
- POSTGRES_PASSWORD=${PGPASSWORD}
|
|
- POSTGRES_DB=${PGDATABASE}
|
|
|
|
api:
|
|
build:
|
|
context: ./api
|
|
dockerfile: Dockerfile
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- "${SERVER_PORT}:${SERVER_PORT}"
|
|
volumes:
|
|
- api:/usr/src/app
|
|
depends_on:
|
|
- db
|
|
command: ./bin/api
|
|
|
|
migrator:
|
|
build:
|
|
context: ./migrator
|
|
dockerfile: Dockerfile
|
|
env_file:
|
|
- .env
|
|
depends_on:
|
|
- api
|
|
- db
|
|
volumes:
|
|
- goose:/migrations
|
|
command: goose up
|
|
|
|
spa:
|
|
build: .
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- "${HTTP}:${HTTP}"
|
|
- "${HTTPS}:${HTTPS}"
|
|
volumes:
|
|
- ./data/nginx/conf.d:/etc/nginx/conf.d
|
|
- ./data/certbot/conf:/etc/letsencrypt
|
|
- ./data/certbot/www:/var/www/certbot
|
|
depends_on:
|
|
- api
|
|
- db
|
|
- migrator
|
|
- certbot
|
|
|
|
certbot:
|
|
image: certbot/certbot
|
|
volumes:
|
|
- ./data/certbot/conf:/etc/letsencrypt
|
|
- ./data/certbot/www:/var/www/certbot
|
|
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
|
|
restart: unless-stopped |