This guide covers production deployment with Docker and Nginx reverse proxy setup.
The project includes a production Docker target that serves the app via Gunicorn under Supervisord.
-
Copy and configure your environment file:
cp .env.example .env
At minimum, set
SECRET_KEY,VIDA_XSL_HOST_PATH, andVIDA_DB_HOST_PATH. -
Build and start the production stack:
docker-compose up -d flask-prod
This starts the
flask-prodservice (port5000) along with thevida-dbSQL Server container. -
(Optional) Start DbGate for database management:
docker-compose up -d dbgate
DbGate is accessible at
http://localhost:3005.
In production, Nginx should sit in front of the container to handle TLS termination and static asset caching. The steps below are for Debian.
By default Docker writes iptables rules directly, bypassing UFW. Disable this by editing (or creating) /etc/docker/daemon.json:
{
"iptables": false
}sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw reloadsudo apt update && sudo apt install -y nginx
sudo cp openvida.nginx /etc/nginx/sites-available/openvidaEdit the site config to adjust the server_name to your domain name:
sudo nano /etc/nginx/sites-available/openvidaEnable the site and start Nginx:
sudo ln -s /etc/nginx/sites-available/openvida /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl enable nginx
sudo systemctl start nginxReplace openvida.net with your domain:
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d openvida.netCertbot will update the config to redirect HTTP -> HTTPS automatically.
After editing daemon.json, flush the stale Docker rules and restart:
sudo systemctl stop docker
sudo iptables -F DOCKER
sudo iptables -F DOCKER-ISOLATION-STAGE-1
sudo iptables -F DOCKER-ISOLATION-STAGE-2
sudo iptables -F DOCKER-USER
sudo systemctl start docker
docker compose up -d flask-prod