Production deployment fixes and enhancements

- Added environment variable loading with python-dotenv
- Fixed Docker session permissions by using /tmp directory
- Updated .dockerignore to include .env file properly
- Enhanced docker-compose.yml with env_file directive
- Fixed Gunicorn configuration for Docker compatibility
- Updated README.md with comprehensive deployment docs
- Cleaned up debug logging from API routes
- Added DOMAIN_SETUP.md for reverse proxy guidance
- All production issues resolved and tested working
- Application now accessible at qr.moto-adv.com
This commit is contained in:
ske087
2025-07-16 17:49:10 -04:00
parent e9a8f5e622
commit 264a81652a
27 changed files with 140 additions and 24 deletions

26
docker-compose.yml Normal file → Executable file
View File

@@ -6,17 +6,17 @@ services:
container_name: qr-code-manager
restart: unless-stopped
ports:
- "5000:5000"
- "8066:5000"
env_file:
- .env
environment:
- FLASK_ENV=production
- SECRET_KEY=${SECRET_KEY:-your-super-secret-key-change-me}
- ADMIN_USERNAME=${ADMIN_USERNAME:-admin}
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin123}
volumes:
- qr_data:/app/app/static/qr_codes
- logo_data:/app/app/static/logos
- session_data:/app/flask_session
- persistent_data:/app/data
# Map to specific folders on your host system
- /opt/qr/qr_codes:/app/app/static/qr_codes
- /opt/qr/logos:/app/app/static/logos
- /opt/qr/sessions:/app/flask_session
- /opt/qr/persistent:/app/data
healthcheck:
test: ["CMD", "python", "-c", "import requests; requests.get('http://localhost:5000/health')"]
interval: 30s
@@ -27,16 +27,6 @@ services:
- "com.example.description=QR Code Manager Application"
- "com.example.service=qr-manager"
volumes:
qr_data:
driver: local
logo_data:
driver: local
session_data:
driver: local
persistent_data:
driver: local
networks:
default:
name: qr-manager-network