423c596c28
- Add entrypoint.sh: creates /app/data, stamps legacy DBs, runs alembic upgrade head - Update Dockerfile to use new entrypoint and pre-create /app/data - Change default DATABASE_URL to sqlite:///./data/dmarq.db - Add _ensure_sqlite_dir() to database.py for automatic directory creation - Update docker-compose.yml with app_data named volume for /app/data - Add 6 tests for _ensure_sqlite_dir and updated default URL Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/2bac317b-97a2-450b-84f1-3e316f7ef54c Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
56 lines
1.4 KiB
YAML
56 lines
1.4 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# Database service
|
|
db:
|
|
image: postgres:14-alpine
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
environment:
|
|
- POSTGRES_PASSWORD=dmarq_secure_password
|
|
- POSTGRES_USER=dmarq_user
|
|
- POSTGRES_DB=dmarq_db
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U dmarq_user -d dmarq_db"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- dmarq-network
|
|
ports:
|
|
- "5433:5432" # Map to non-standard port to avoid conflicts
|
|
|
|
# Integrated backend with frontend service
|
|
app:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
volumes:
|
|
- ./backend:/app # development: mount source code for live reload
|
|
- app_data:/app/data # persist SQLite database and other application data
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
- DATABASE_URL=postgresql://dmarq_user:dmarq_secure_password@db:5432/dmarq_db
|
|
- SECRET_KEY=your_secret_key_change_in_production
|
|
- DEBUG=True
|
|
- ENVIRONMENT=development
|
|
# Add NODE_ENV for Tailwind
|
|
- NODE_ENV=production
|
|
networks:
|
|
- dmarq-network
|
|
ports:
|
|
- "80:8080" # Map directly to port 80 for web access
|
|
|
|
# Define networks
|
|
networks:
|
|
dmarq-network:
|
|
driver: bridge
|
|
|
|
# Define volumes
|
|
volumes:
|
|
postgres_data:
|
|
driver: local
|
|
app_data:
|
|
driver: local |