[add]: Database connection and migrations
This commit is contained in:
+29
-4
@@ -1,11 +1,36 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
digifi-flaska002:
|
||||
db:
|
||||
image: postgres:13
|
||||
environment:
|
||||
- POSTGRES_USER=${DATABASE_USER}
|
||||
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
|
||||
- POSTGRES_DB=${DATABASE_NAME}
|
||||
ports:
|
||||
- "${DATABASE_PORT}:${DATABASE_PORT}"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${DATABASE_USER} -d ${DATABASE_NAME}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
digifi-bank-to-product-core:
|
||||
build: .
|
||||
ports:
|
||||
- "4500:5000"
|
||||
- "${APP_PORT:-4500}:5000"
|
||||
environment:
|
||||
- FLASK_APP=app.py
|
||||
- FLASK_RUN_HOST=0.0.0.0
|
||||
- FLASK_APP=wsgi.py
|
||||
- FLASK_ENV=development
|
||||
- DATABASE_URL=postgresql+psycopg2://${DATABASE_USER}:${DATABASE_PASSWORD}@db:${DATABASE_PORT}/${DATABASE_NAME}?options=-csearch_path%3Dflask_app
|
||||
volumes:
|
||||
- .:/app
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
Reference in New Issue
Block a user