From 570b05f62f195f7f24b28274f183693759ca8b4f Mon Sep 17 00:00:00 2001 From: iritmaximus Date: Sun, 5 Feb 2023 20:08:44 +0200 Subject: [PATCH] none: moved old compose file to docs, in case we need it :D --- docs/compose-with-db.yml | 50 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 docs/compose-with-db.yml diff --git a/docs/compose-with-db.yml b/docs/compose-with-db.yml new file mode 100644 index 0000000..b9e791c --- /dev/null +++ b/docs/compose-with-db.yml @@ -0,0 +1,50 @@ +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: