Deployment & Production Guide

Metupy runs on standard WSGI (Flask) and can be deployed to VPS, Docker, Render, Railway, or Fly.io.

Production Architecture
For production environments, always use a WSGI HTTP Server such as Gunicorn.

1. Running with Gunicorn

Ensure your entrypoint (e.g., app.py) exposes app = server.app:

app.py
from metupy.engine import MetupyServer

server = MetupyServer()
app = server.app

if __name__ == "__main__":
    server.run()
Terminal
gunicorn -w 4 -b 0.0.0.0:5000 app:app

2. Docker Deployment

Create a Dockerfile in your root directory:

Dockerfile
FROM python:3.11-slim

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

EXPOSE 5000

CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:5000", "app:app"]

3. Cloud Hosting Options

VPS (Ubuntu / Nginx)

Best for high performance. Use Nginx as a reverse proxy and Systemd to manage the Gunicorn service.

Cloud PaaS (Render / Railway)

Easiest deployment method. Connect your GitHub repository and set start command to gunicorn app:app.
Performance Tip
Enable Nginx gzip compression for static CSS/JS assets to optimize global loading times.