version: "3.8" services: db: container_name: pgdb_flask image: postgres:15.1-alpine env_file: - .env environment: POSTGRES_DB: ${POSTGRES_DB} POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} ports: - 6432:5432 healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] interval: 10s timeout: 5s retries: 5 app: container_name: flask_demo build: context: . dockerfile: ./docker/app/Dockerfile ports: - 8080:5000 depends_on: db: condition: service_healthy volumes: - ./flask_demo_api:/usr/src/flask-webhook/flask_demo_api - ./config/:/usr/src/flask-webhook/config - ./alembic.ini:/usr/src/flask-webhook/alembic.ini command: /bin/bash -c 'alembic upgrade head && poetry run app'