name: news services: backend: build: context: . dockerfile: Dockerfile container_name: ${COMPOSE_PROJECT_NAME}_backend restart: unless-stopped environment: DATABASE_URL: "postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:5432/${DB_NAME}?schema=public" JWT_SECRET: ${JWT_SECRET} EMAIL_TRANSPORT: ${EMAIL_TRANSPORT} EMAIL_FROM: ${EMAIL_FROM} SMTP_HOST: ${EMAIL_SMTP_HOST} SMTP_PORT: ${EMAIL_SMTP_PORT} SMTP_USER: ${EMAIL_SMTP_USER} SMTP_PASSWORD: ${EMAIL_SMTP_PASSWORD} # Node.js image should have curl # healthcheck: # test: ["CMD-SHELL", "curl -f http://localhost:$APP_PORT/api/v1/health || exit 1"] # interval: 30s # timeout: 10s # retries: 3 # start_period: 40s networks: - kompose_network labels: - 'traefik.enable=true' - 'traefik.http.middlewares.$COMPOSE_PROJECT_NAME-redirect-web-secure.redirectscheme.scheme=https' - 'traefik.http.routers.$COMPOSE_PROJECT_NAME-web.middlewares=$COMPOSE_PROJECT_NAME-redirect-web-secure' - 'traefik.http.routers.$COMPOSE_PROJECT_NAME-web.rule=Host(`$TRAEFIK_HOST`)' - 'traefik.http.routers.$COMPOSE_PROJECT_NAME-web.entrypoints=web' - 'traefik.http.routers.$COMPOSE_PROJECT_NAME-web-secure.rule=Host(`$TRAEFIK_HOST`)' - 'traefik.http.routers.$COMPOSE_PROJECT_NAME-web-secure.tls.certresolver=resolver' - 'traefik.http.routers.$COMPOSE_PROJECT_NAME-web-secure.entrypoints=web-secure' - 'traefik.http.middlewares.$COMPOSE_PROJECT_NAME-web-secure-compress.compress=true' - 'traefik.http.routers.$COMPOSE_PROJECT_NAME-web-secure.middlewares=$COMPOSE_PROJECT_NAME-web-secure-compress' - 'traefik.http.services.$COMPOSE_PROJECT_NAME-web-secure.loadbalancer.server.port=$APP_PORT' - 'traefik.docker.network=${NETWORK_NAME:-kompose}' networks: kompose_network: name: ${NETWORK_NAME:-kompose} external: true