45 lines
1.2 KiB
YAML
Executable File
45 lines
1.2 KiB
YAML
Executable File
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
container_name: telco-db
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: telco
|
|
POSTGRES_USER: telco
|
|
POSTGRES_PASSWORD: ${TELCO_DB_PASSWORD:-telco}
|
|
volumes:
|
|
- telco-db-data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U telco -d telco"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
telcoportal:
|
|
build:
|
|
# Use the repository root so the tracked legacy database is packaged into the image.
|
|
context: .
|
|
dockerfile: TelcoPortal-source/Dockerfile
|
|
container_name: telcoportal
|
|
restart: unless-stopped
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
ports:
|
|
- "8092:8000"
|
|
volumes:
|
|
- telco-app-data:/app/data
|
|
environment:
|
|
TELCO_DATA_DIR: /app/data
|
|
TELCO_DB_HOST: db
|
|
TELCO_DB_PORT: 5432
|
|
TELCO_DB_NAME: telco
|
|
TELCO_DB_USER: telco
|
|
TELCO_DB_PASSWORD: ${TELCO_DB_PASSWORD:-telco}
|
|
TELCO_LEGACY_SQLITE_PATH: /app/legacy-data/telco.db
|
|
command: ["sh", "-c", "python migrate_sqlite.py && exec gunicorn --bind 0.0.0.0:8000 --workers 2 app:app"]
|
|
|
|
volumes:
|
|
telco-db-data:
|
|
telco-app-data:
|