Overview
Interview Simulator is containerized using Docker and can be deployed to any environment that supports Docker containers. The application uses Gunicorn as the production WSGI server.Docker Deployment
Prepare environment variables
Create a Edit the
.env file based on .env.example with your production credentials:.env file and set required values:SECRET_KEY: A strong random secret for Flask sessionsGEMINI_API_KEY: Your Google Gemini API key (optional if using OpenRouter)OPENROUTER_API_KEY: Your OpenRouter API key (optional if using Gemini)FLASK_ENV: Set toproductionDATABASE_URL: Database connection string (defaults to SQLite)
Build the Docker image
The Dockerfile uses Python 3.14 slim base image and installs dependencies from The image:
requirements.txt:- Installs Python dependencies
- Copies application code to
/app - Exposes port 8000
- Runs Gunicorn with 4 workers
Run with Docker Compose
Use the provided This configuration:
docker-compose.yml for easy orchestration:- Builds the image from the current directory
- Maps port 8000 to the host
- Loads environment variables from
.env - Mounts
./instancedirectory for SQLite database persistence
Production Considerations
WSGI Server
The application uses Gunicorn as the production WSGI server, configured in the Dockerfile:wsgi.py file at the project root serves as the entry point:
app/wsgi.py
Worker Configuration
The default configuration uses 4 Gunicorn workers. Adjust based on your server resources:(2 * CPU_cores) + 1
Database Persistence
By default, the application uses SQLite with the database stored in theinstance/ directory. The docker-compose configuration mounts this directory as a volume:
Reverse Proxy
For production deployments, run the application behind a reverse proxy like Nginx:Security Checklist
Generate a strong SECRET_KEY
Never use the default
dev-secret-key-change-in-production in production:Configure file upload limits
The default
MAX_CONTENT_LENGTH is 16MB. Adjust if needed for your use case.Monitoring and Logs
View application logs:- HTTP request logs (access log)
- Application errors (error log)
- Worker process information
Scaling
To scale horizontally:- Use a shared database (PostgreSQL) instead of SQLite
- Deploy multiple container instances behind a load balancer
- Configure shared storage for uploads (S3, NFS, etc.)
- Use a centralized session store (Redis) if needed