version: "3.8" services: db: image: postgres:15.1-alpine env_file: - .env container_name: pgdatabase ports: - 6432:5432 healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"] interval: 10s timeout: 5s retries: 5 volumes: - ./scripts/db_prepare.sql:/docker-entrypoint-initdb.d/db_prepare.sql app: build: context: . container_name: fastfood_app env_file: - .env command: ["/fastfood/scripts/migrate_and_run.sh"] ports: - 8000:8000 depends_on: db: condition: service_healthy restart: always tests: build: context: . container_name: tests env_file: - .env depends_on: db: condition: service_healthy app: condition: service_started command: ["/fastfood/scripts/testing.sh"]