services: payment-gateway: build: . ports: - "8787:8787" environment: SPRING_PROFILES_ACTIVE: postgres SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/paymentdb SPRING_DATASOURCE_USERNAME: postgres SPRING_DATASOURCE_PASSWORD: postgres GATEWAY_REDIS_ENABLED: "true" SPRING_DATA_REDIS_HOST: redis depends_on: postgres: condition: service_healthy redis: condition: service_healthy networks: - gateway-net postgres: image: postgres:16-alpine environment: POSTGRES_DB: paymentdb POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres ports: - "5432:5432" volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 3s retries: 5 networks: - gateway-net redis: image: redis:7-alpine ports: - "6379:6379" healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 5 networks: - gateway-net volumes: pgdata: networks: gateway-net: