Files
timetrials/docs/compose-with-db.yml
T

51 lines
1.0 KiB
YAML

services:
flask:
# adding this ****ing little **** took at least 3 hours of debugging
# command: sh -c "gunicorn -w 4 flaskr:app -b 0.0.0.0:5000 --access-logfile '-' --error-logfile '-'"
build:
context: .
dockerfile: Dockerfile
ports:
- "5000:5000"
volumes:
- .:/app
env_file: .env
environment:
- POSTGRES_DB
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_URL
- ENVIRONMENT=production
depends_on:
db:
condition: service_healthy
db:
image: postgres:bullseye
volumes:
- postgres_db:/var/lib/postgresql/data
env_file: .env
environment:
- POSTGRES_DB
- POSTGRES_USER
- POSTGRES_PASSWORD
restart: always
expose:
- 5432
healthcheck:
test: sh -c "pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}"
interval: 3s
timeout: 2s
retries: 30
# adminer:
# image: adminer
# restart: always
# ports:
# - 8080:8080
volumes:
postgres_db: