[update]: docker compose file
This commit is contained in:
+1
-1
@@ -8,7 +8,7 @@ WORKDIR /app
|
|||||||
COPY . /app
|
COPY . /app
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN pip install --no-cache-dir -r requirements.txt --verbose
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
# Expose port 5000 for the Flask app
|
# Expose port 5000 for the Flask app
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
|||||||
+1
-5
@@ -3,9 +3,6 @@ import os
|
|||||||
class Config:
|
class Config:
|
||||||
"""Base configuration for Flask app"""
|
"""Base configuration for Flask app"""
|
||||||
|
|
||||||
# SQLALCHEMY_DATABASE_URI = "mysql://root:password@localhost/flask_app"
|
|
||||||
# SQLALCHEMY_TRACK_MODIFICATIONS = False
|
|
||||||
# SECRET_KEY = os.environ.get("SECRET_KEY", "your_secret_key")
|
|
||||||
|
|
||||||
SWAGGER_URL = os.getenv("SWAGGER_URL", "/documentation")
|
SWAGGER_URL = os.getenv("SWAGGER_URL", "/documentation")
|
||||||
API_URL = os.getenv("API_URL", "/swagger.json")
|
API_URL = os.getenv("API_URL", "/swagger.json")
|
||||||
@@ -23,7 +20,6 @@ class Config:
|
|||||||
DATABASE_NAME = os.environ.get("DATABASE_NAME")
|
DATABASE_NAME = os.environ.get("DATABASE_NAME")
|
||||||
|
|
||||||
SQLALCHEMY_DATABASE_URI = (
|
SQLALCHEMY_DATABASE_URI = (
|
||||||
# f"postgresql+psycopg2://{DATABASE_USER}:{DATABASE_PASSWORD}@{DATABASE_HOST}:{DATABASE_PORT}/{DATABASE_NAME}"
|
f"postgresql+psycopg2://{DATABASE_USER}:{DATABASE_PASSWORD}@{DATABASE_HOST}:{DATABASE_PORT}/{DATABASE_NAME}"
|
||||||
f"postgresql+psycopg2://{DATABASE_USER}:{DATABASE_PASSWORD}@{DATABASE_HOST}:{DATABASE_PORT}/{DATABASE_NAME}"
|
|
||||||
)
|
)
|
||||||
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||||||
+3
-25
@@ -1,34 +1,12 @@
|
|||||||
services:
|
services:
|
||||||
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:
|
digifi-bank-to-product-core:
|
||||||
build: .
|
build: .
|
||||||
ports:
|
ports:
|
||||||
- "${APP_PORT:-4500}:5000"
|
- "${APP_PORT:-4500}:5000"
|
||||||
environment:
|
environment:
|
||||||
- FLASK_APP=wsgi.py
|
- FLASK_APP=${FLASK_APP}
|
||||||
- FLASK_ENV=development
|
- FLASK_ENV=${FLASK_ENV}
|
||||||
- DATABASE_URL=postgresql+psycopg2://${DATABASE_USER}:${DATABASE_PASSWORD}@db:${DATABASE_PORT}/${DATABASE_NAME}
|
- DATABASE_URL=postgresql+psycopg2://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME}
|
||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .:/app
|
||||||
depends_on:
|
|
||||||
db:
|
|
||||||
condition: service_healthy
|
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
volumes:
|
|
||||||
postgres_data:
|
|
||||||
Reference in New Issue
Block a user