34 lines
805 B
Docker
34 lines
805 B
Docker
# syntax=docker/dockerfile:1
|
|
|
|
FROM python:3.12-slim
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1
|
|
|
|
WORKDIR /app
|
|
|
|
# System deps (kept minimal). Pillow may need some libs; for most cases this is fine on slim.
|
|
# If you hit Pillow build/runtime issues, consider adding: libjpeg62-turbo, zlib1g, etc.
|
|
|
|
COPY requirements.txt ./
|
|
RUN pip install --no-cache-dir -r requirements.txt \
|
|
&& pip install --no-cache-dir gunicorn
|
|
|
|
COPY . .
|
|
|
|
# Ensure entrypoint is executable
|
|
RUN chmod +x docker/entrypoint.sh
|
|
|
|
# Create runtime dirs (also mountable as volumes)
|
|
RUN mkdir -p instance app/static/uploads
|
|
|
|
EXPOSE 8000
|
|
|
|
# Default config (override at runtime)
|
|
ENV FLASK_ENV=production \
|
|
GUNICORN_WORKERS=2 \
|
|
GUNICORN_BIND=0.0.0.0:8000
|
|
|
|
# Run via WSGI entrypoint
|
|
CMD ["sh", "-c", "./docker/entrypoint.sh"]
|