version: '3.8' services: postgres: image: postgres:15 container_name: asta-resource-repository-db environment: POSTGRES_USER: asta_resources POSTGRES_PASSWORD: asta_resources POSTGRES_DB: asta_resources ports: - "15432:5432" volumes: - postgres_data:/var/lib/postgresql/data - ./migrations:/docker-entrypoint-initdb.d networks: - asta-resource-repository-network healthcheck: test: ["CMD-SHELL", "pg_isready -U asta_resources"] interval: 5s timeout: 5s retries: 5 api: build: context: . dockerfile: Dockerfile image: asta-resource-repository:latest container_name: asta-resource-repository-api depends_on: postgres: condition: service_healthy environment: POSTGRES_HOST: postgres POSTGRES_PORT: 5432 POSTGRES_DB: asta_resources POSTGRES_USER: asta_resources POSTGRES_PASSWORD: asta_resources ports: - "8000:8000" networks: - asta-resource-repository-network networks: asta-resource-repository-network: name: asta-resource-repository-network driver: bridge volumes: postgres_data: