version: '3' networks: local: volumes: db: services: auth-service: build: dockerfile: ./Dockerfile env_file: - .env ports: - "8090:8090" depends_on: # postgres: # condition: service_healthy # valkey: # condition: service_healthy migrate: condition: service_completed_successfully networks: - local postgres: image: postgres:14.1-alpine restart: always environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: supersecretpassword networks: - local ports: - '5432:5432' volumes: - db:/var/lib/postgresql/data healthcheck: test: pg_isready -U postgres -d postgres interval: 10s timeout: 3s retries: 5 migrate: image: ghcr.io/kukymbr/goose-docker:latest networks: - local volumes: - ./migrations:/migrations environment: GOOSE_DRIVER: "postgres" GOOSE_DBSTRING: "host=postgres user=postgres password=supersecretpassword dbname=postgres port=5432 sslmode=disable" depends_on: postgres: condition: service_healthy valkey: container_name: valkey hostname: valkey image: valkey/valkey:latest build: . volumes: - ./conf/valkey.conf:/usr/local/etc/valkey/valkey.conf - ./data:/data command: ["valkey-server", "/usr/local/etc/valkey/valkey.conf"] healthcheck: test: ["CMD-SHELL", "valkey-cli ping | grep PONG"] interval: 1s timeout: 3s retries: 5 ports: - 6379:6379 networks: - local