services: migrate: build: . depends_on: db: condition: service_healthy environment: - DATABASE_URL=postgres://postgres:postgres@db:5432/postgres command: ["./server", "migrate"] restart: "no" app: build: . depends_on: db: condition: service_healthy migrate: condition: service_completed_successfully ports: - "3000:3000" environment: - DATABASE_URL=postgres://postgres:postgres@db:5432/postgres db: image: postgres:18-alpine # ports: # - "5432:5432" volumes: - postgres_data:/var/lib/postgresql environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: postgres healthcheck: test: [ "CMD", "pg_isready", "-U", "postgres" ] interval: 10s timeout: 5s retries: 5 volumes: postgres_data: