Deploy
Deployment
The frontend build output is written to the project root dist/. It can be served directly by Flask or exposed
through Nginx as the static layer.
Frontend build
cd frontend
npm install
npm run build
After the build completes, static files appear in the project root dist/ directory.
Serve through Flask
python run.py --env prod
Flask serves the frontend build output through app/routes/react_app.py and returns index.html for non-API routes.
- Local production access:
http://127.0.0.1:5000/ - Development access:
http://127.0.0.1:5001/
Nginx example
server {
listen 80;
server_name app.dbface.com;
root /home/ec2-user/DbFace2/dist;
index index.html;
location /api/ {
proxy_pass http://127.0.0.1:5001/api/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location / {
try_files $uri $uri/ /index.html;
}
}
In production it is usually better to proxy to port
5000. Use 5001 only when you intentionally want the development backend.
Docker Compose
The project includes docker-compose.yml for running the app together with PostgreSQL and Redis.
docker compose up -d --build
Release checklist
- Your domain resolves to the target server.
- The server allows inbound traffic on port 80 or 443.
- The frontend build is complete and
dist/index.htmlexists. - The backend process is reachable and API routes respond correctly.
- Database, JWT, and encryption-related environment variables are configured correctly.