FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt paramiko gunicorn
COPY . .
# Persistent data (SQLite, backups, reports) should be a mounted volume at /app
EXPOSE 8765
# Gunicorn for production serving; threads because jobs run in background threads
CMD ["gunicorn", "--bind", "0.0.0.0:8765", "--threads", "8", "--timeout", "300", "app:app"]
