name: tnsu-approval-route services: postgres: image: postgres:16-alpine container_name: tnsu-approval-route-postgres restart: unless-stopped environment: POSTGRES_DB: ${POSTGRES_DB:-tnsu_approval_route} POSTGRES_USER: ${POSTGRES_USER:-tnsu_approval_route} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-tnsu_approval_route} ports: - "${POSTGRES_PORT:-5435}:5432" volumes: - approval-route-postgres-data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-tnsu_approval_route} -d ${POSTGRES_DB:-tnsu_approval_route}"] interval: 5s timeout: 3s retries: 10 api: build: context: ./backend dockerfile: src/Tnsu.ApprovalRoute.Api/Dockerfile container_name: tnsu-approval-route-api restart: unless-stopped depends_on: postgres: condition: service_healthy environment: ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT:-Development} ASPNETCORE_URLS: http://+:8080 ConnectionStrings__Postgres: "Host=postgres;Port=5432;Database=${POSTGRES_DB:-tnsu_approval_route};Username=${POSTGRES_USER:-tnsu_approval_route};Password=${POSTGRES_PASSWORD:-tnsu_approval_route}" ports: - "${API_PORT:-8082}:8080" healthcheck: test: ["CMD", "curl", "-fsS", "http://127.0.0.1:8080/health"] interval: 10s timeout: 5s retries: 10 start_period: 30s volumes: approval-route-postgres-data: