implement gunicorn WSGI

This commit is contained in:
Bryan Van Deusen
2025-08-14 13:34:29 -04:00
parent 3420cf01ff
commit 0d56daa664
4 changed files with 52 additions and 44 deletions
+8 -16
View File
@@ -1,31 +1,23 @@
# Dockerfile
FROM python:slim
# Set work directory
WORKDIR /app
# Install PostgreSQL client
# Only what you actually need (ffmpeg kept for video/thumbs)
RUN apt-get update && \
apt-get install -y postgresql-client ffmpeg && \
apt-get clean && \
apt-get install -y --no-install-recommends ffmpeg && \
rm -rf /var/lib/apt/lists/*
# Copy project files
# Install deps first for better layer caching
COPY requirements.txt .
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
# Copy the rest of the app
COPY . .
# Install dependencies
RUN pip install --upgrade pip && pip install -r requirements.txt
# Copy and prepare entrypoint script
# Entrypoint controls migrations, background worker, and Gunicorn
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Set environment variables
ENV FLASK_APP=run.py
ENV FLASK_RUN_HOST=0.0.0.0
# Expose port
EXPOSE 5000
# Use entrypoint script
ENTRYPOINT ["/entrypoint.sh"]