mirror of
https://github.com/iritmaximus/timetrials.git
synced 2026-10-12 19:13:48 +03:00
feat: communication between flask and postgres and fly.io
This commit is contained in:
+18
-2
@@ -1,7 +1,7 @@
|
|||||||
services:
|
services:
|
||||||
flask:
|
flask:
|
||||||
# adding this ****ing little **** took at least 3 hours of debugging
|
# 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"
|
command: sh -c "gunicorn -w 4 flaskr:app -b 0.0.0.0:5000 --access-logfile '-' --error-logfile '-'"
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
@@ -9,6 +9,13 @@ services:
|
|||||||
- "5000:5000"
|
- "5000:5000"
|
||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .:/app
|
||||||
|
env_file: .env
|
||||||
|
environment:
|
||||||
|
- POSTGRES_DB
|
||||||
|
- POSTGRES_USER
|
||||||
|
- POSTGRES_PASSWORD
|
||||||
|
- POSTGRES_URL
|
||||||
|
- ENVIRONMENT=production
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@@ -18,7 +25,7 @@ services:
|
|||||||
db:
|
db:
|
||||||
image: postgres:bullseye
|
image: postgres:bullseye
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/db:/var/lib/postgresql/data
|
- postgres_db:/var/lib/postgresql/data
|
||||||
env_file: .env
|
env_file: .env
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_DB
|
- POSTGRES_DB
|
||||||
@@ -30,3 +37,12 @@ services:
|
|||||||
interval: 3s
|
interval: 3s
|
||||||
timeout: 2s
|
timeout: 2s
|
||||||
retries: 30
|
retries: 30
|
||||||
|
|
||||||
|
adminer:
|
||||||
|
image: adminer
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- 8080:8080
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
postgres_db:
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ processes = []
|
|||||||
[experimental]
|
[experimental]
|
||||||
auto_rollback = true
|
auto_rollback = true
|
||||||
|
|
||||||
|
[mounts]
|
||||||
|
source="tsoha_postgres_volume"
|
||||||
|
destination="/var/lib/postgresql/data"
|
||||||
|
|
||||||
[[services]]
|
[[services]]
|
||||||
http_checks = []
|
http_checks = []
|
||||||
internal_port = 5000
|
internal_port = 5000
|
||||||
|
|||||||
Reference in New Issue
Block a user