implement gunicorn WSGI
This commit is contained in:
+8
-16
@@ -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"]
|
||||
Reference in New Issue
Block a user