services: postgres: image: postgres:15-alpine container_name: quixotic-postgres restart: unless-stopped env_file: - .env.docker environment: POSTGRES_DB: ${POSTGRES_DB:-quixotic} POSTGRES_USER: ${POSTGRES_USER:-quixotic} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-quixotic123} volumes: - postgres-data:/var/lib/postgresql/data - ./database/init:/docker-entrypoint-initdb.d networks: - quixotic healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-quixotic}"] interval: 5s timeout: 5s retries: 5 quixotic-app: build: context: . dockerfile: Dockerfile container_name: quixotic-app restart: unless-stopped env_file: - .env.docker environment: NODE_ENV: production PORT: 3000 DATABASE_URL: postgresql://${POSTGRES_USER:-quixotic}:${POSTGRES_PASSWORD:-quixotic123}@postgres:5432/${POSTGRES_DB:-quixotic} DATABASE_SSL: false volumes: - downloads:/app/downloads labels: - "traefik.enable=true" - "traefik.http.routers.quixotic.rule=Host(`${DOMAIN}`)" - "traefik.http.routers.quixotic.entrypoints=websecure" - "traefik.http.routers.quixotic.tls.certresolver=letsencrypt" - "traefik.http.routers.quixotic.service=quixotic" - "traefik.http.services.quixotic.loadbalancer.server.port=3000" - "traefik.docker.network=traefik-global" depends_on: postgres: condition: service_healthy networks: - quixotic - traefik-global volumes: downloads: postgres-data: networks: quixotic: driver: bridge traefik-global: external: true