prodv1
This commit is contained in:
30
Dockerfile
Normal file
30
Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
# 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 . .
|
||||
|
||||
# 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", "gunicorn -w ${GUNICORN_WORKERS} -b ${GUNICORN_BIND} wsgi:app"]
|
||||
Reference in New Issue
Block a user