Prerequisites
- Docker (version 20.10 or higher)
- Docker Compose (version 2.0 or higher, included with Docker Desktop)
- Git (for cloning the repository)
The Docker image supports multiple architectures: AMD64, ARM64, and ARMv7 (Raspberry Pi compatible).
Quick Start with Docker
Build the Docker image
Navigate to the docker directory and build the image:The build process:
- Stage 1: Builds the React frontend using Node.js 20 Alpine
- Stage 2: Sets up Python 3.11 backend and serves the built frontend
Docker Compose Deployment
For production deployments with proper configuration, use docker-compose.Using the Provided docker-compose.yml
Review the configuration
The included
docker/docker-compose.yml provides a production-ready setup:docker-compose.yml
Customize environment variables
Edit the environment variables according to your needs:
- PGID/PUID: User/Group ID for file permissions (default: 1000)
- TZ: Timezone (e.g.,
America/New_York,Europe/London) - FLASK_ENV: Set to
productionfor deployment - FLASK_DEBUG: Keep as
falsein production
Adjust volume paths
Update the volume paths to match your system:
Create these directories before starting the container to avoid permission issues.
Dockerfile Architecture
The multi-stage Dockerfile optimizes the build process:Stage 1: Frontend Build
- Uses Node.js 20 Alpine for minimal image size
- Installs dependencies and builds optimized production bundle
- Output saved to
/app/frontend/project/dist
Stage 2: Backend + Static Files
System dependencies are required for:
- cloudscraper: Cloudflare bypass functionality
- beautifulsoup4: HTML parsing
- Compilation of native Python packages on Alpine Linux
Managing the Container
View Logs
Check Container Status
Stop the Container
Restart the Container
Remove the Container
Updating the Application
Using Docker Compose
Network Access
Local Network Access
The application is accessible from any device on your network:Port Configuration
Health Monitoring
The docker-compose configuration includes a health check:/api/secciones endpoint every 30 seconds to ensure the application is responsive.
Check Health Status
Troubleshooting
Build fails on ARM devices
Build fails on ARM devices
The Dockerfile is optimized for ARM architectures. If you encounter issues:
- Ensure you’re using the correct platform:
- Check available disk space (builds require ~2GB)
Container exits immediately
Container exits immediately
Check the logs for errors:Common issues:
- Missing environment variables
- Port 1234 already in use
- Insufficient memory
Cannot access from network
Cannot access from network
- Verify the container is running:
docker ps - Check firewall settings (port 1234)
- Ensure the container is bound to 0.0.0.0, not 127.0.0.1
- Test locally first:
curl http://localhost:1234
High memory usage
High memory usage
Adjust the memory limit in docker-compose.yml:
Next Steps
CasaOS Deployment
Deploy to CasaOS for easier management
Architecture Overview
Learn about the system architecture