File size: 604 Bytes
924fd67
 
 
 
 
a96145c
 
7979efb
 
924fd67
a96145c
 
7979efb
a96145c
7979efb
a96145c
924fd67
7979efb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
FROM python:3.12-slim AS builder
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

FROM python:3.12-slim
WORKDIR /app
RUN addgroup --system app && adduser --system --group app && \
    pip install --no-cache-dir gunicorn
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
COPY . .
USER app
EXPOSE 7860
ENV FLASK_ENV=production \
    PORT=7860 \
    HOST=0.0.0.0 \
    LOG_LEVEL=INFO
CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:7860", "--timeout", "300", "--access-logfile", "-", "--error-logfile", "-", "webapp:app"]