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 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: - certbot_data:/etc/letsencrypt - certbot_www:/var/www/certbot - ./spa/app:/usr/share/nginx/html networks: - web-network depends_on: - certbot certbot: build: context: ./certbot dockerfile: Dockerfile container_name: certbot volumes: - certbot_data:/etc/letsencrypt - certbot_www:/var/www/certbot env_file: - .env environment: - EMAIL=valitovgaziz@yandex.ru - DOMAINS=yalarba.ru - STAGING=0 restart: unless-stopped volumes: api: postgres-db: goose: certbot_data: certbot_www: networks: web-network: driver: bridge