- Implement Docker image-based deployment (Option 1) * Code immutable in image, no volume override * Eliminated init-data.sh manual step * Simplified deployment process - Unified persistence in data/ folder * Moved nginx.conf and nginx-custom-domains.conf to data/ * All runtime configs and data in single location * Clear separation: repo (source) vs data/ (runtime) - Archive legacy features * Groups blueprint and templates removed * Legacy playlist routes redirected to content area * Organized in old_code_documentation/ - Added network migration support * New migrate_network.sh script for IP changes * Regenerates SSL certs for new IP * Updates database configuration * Tested workflow: clone → deploy → migrate - Enhanced deploy.sh * Creates data directories * Copies nginx configs from repo to data/ * Validates file existence before deployment * Prevents incomplete deployments - Updated documentation * QUICK_DEPLOYMENT.md shows 4-step workflow * Complete deployment workflow documented * Migration procedures included - Production ready deployment workflow: 1. Clone & setup (.env configuration) 2. Deploy (./deploy.sh) 3. Migrate network (./migrate_network.sh if needed) 4. Normal operations (docker compose restart)
62 lines
1.8 KiB
YAML
62 lines
1.8 KiB
YAML
#version: '3.8'
|
|
|
|
services:
|
|
digiserver-app:
|
|
build: .
|
|
container_name: digiserver-v2
|
|
# Don't expose directly; use Caddy reverse proxy instead
|
|
expose:
|
|
- "5000"
|
|
volumes:
|
|
# Code is in the Docker image - no volume mount needed
|
|
# Only mount persistent data folders:
|
|
- ./data/instance:/app/instance
|
|
- ./data/uploads:/app/app/static/uploads
|
|
environment:
|
|
- FLASK_ENV=production
|
|
- SECRET_KEY=${SECRET_KEY:-your-secret-key-change-this}
|
|
- ADMIN_USERNAME=${ADMIN_USERNAME:-admin}
|
|
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin123}
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5000/').read()"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
networks:
|
|
- digiserver-network
|
|
|
|
# Nginx reverse proxy with HTTPS support
|
|
nginx:
|
|
image: nginx:alpine
|
|
container_name: digiserver-nginx
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ./data/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
- ./data/nginx-custom-domains.conf:/etc/nginx/conf.d/custom-domains.conf:rw
|
|
- ./data/nginx-ssl:/etc/nginx/ssl:ro
|
|
- ./data/nginx-logs:/var/log/nginx
|
|
- ./data/certbot:/var/www/certbot:ro # For Let's Encrypt ACME challenges
|
|
environment:
|
|
- DOMAIN=${DOMAIN:-localhost}
|
|
- EMAIL=${EMAIL:-admin@localhost}
|
|
depends_on:
|
|
digiserver-app:
|
|
condition: service_started
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:80/"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 10s
|
|
networks:
|
|
- digiserver-network
|
|
|
|
networks:
|
|
digiserver-network:
|
|
driver: bridge
|