Files
tp/docker-compose.yaml
T

97 lines
1.9 KiB
YAML

services:
db:
image: postgres:16
container_name: db
env_file:
- .env
ports:
- "${PGPORT}:${PGPORT}"
volumes:
- postgres-db:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${PGUSER}
- POSTGRES_PASSWORD=${PGPASSWORD}
- POSTGRES_DB=${PGDATABASE}
restart: unless-stopped
api:
container_name: 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
restart: unless-stopped
migrator:
container_name: migrator
build:
context: ./migrator
dockerfile: Dockerfile
env_file:
- .env
depends_on:
- api
- db
volumes:
- goose:/migrations
command: goose up
restart: unless-stopped
spa:
container_name: spa
build:
context: ./spa
dockerfile: Dockerfile
env_file:
- .env
nginx:
build:
context: ./nginx
dockerfile: Dockerfile
env_file: .env
container_name: nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/configs/nginx.conf.template:/etc/nginx/templates/nginx.conf.template
- certbot-etc:/etc/letsencrypt
- ./spa/app:/var/www/yalarba.ru/html
networks:
- web-network
depends_on:
- certbot
certbot:
image: certbot/certbot
container_name: certbot
volumes:
- certbot-etc:/etc/letsencrypt
- certbot-var:/var/lib/letsencrypt
env_file:
- .env
command: sh -c "certbot certonly --standalone -p ${CERTBOT_PORT} --noninteractive --agree-tos --email ${EMAIL} -d ${DOMAINS} --keep-until-expiring"
restart: unless-stopped
volumes:
api:
postgres-db:
goose:
certbot-etc:
certbot-var:
networks:
web-network:
driver: bridge