services: postgres: image: postgres:15-alpine container_name: support-postgres environment: POSTGRES_DB: support_db POSTGRES_USER: support_user POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} volumes: - postgres_data:/var/lib/postgresql/data ports: - "5432:5432" networks: - app-network healthcheck: test: ["CMD-SHELL", "pg_isready -U support_user -d support_db"] interval: 10s timeout: 5s retries: 5 frontend: build: context: . dockerfile: docker/frontend/Dockerfile container_name: support-frontend volumes: - frontend_build:/app/dist networks: - app-network backend: build: context: . dockerfile: docker/backend/Dockerfile container_name: support-backend environment: - DATABASE_URL=postgresql://support_user:${POSTGRES_PASSWORD}@postgres:5432/support_db - TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN} - TELEGRAM_CHAT_ID=${TELEGRAM_CHAT_ID} ports: - "8000:8000" volumes: - ./backend:/app - ./logs:/app/logs:rw networks: - app-network depends_on: postgres: condition: service_healthy restart: unless-stopped nginx: build: context: . dockerfile: docker/nginx/Dockerfile container_name: support-nginx restart: unless-stopped ports: - "80:80" - "443:443" volumes: - frontend_build:/usr/share/nginx/html - ./docker/nginx/conf.d:/etc/nginx/conf.d - ./certbot/conf:/etc/letsencrypt - ./certbot/www:/var/www/certbot networks: - app-network depends_on: - frontend - backend certbot: image: certbot/certbot container_name: support-certbot volumes: - ./certbot/conf:/etc/letsencrypt - ./certbot/www:/var/www/certbot entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'" networks: app-network: driver: bridge volumes: postgres_data: frontend_build: