Zion Boggan zionboggan.com ↗
21 lines · text
History for this file →
1
FROM python:3.11-slim AS base
2
 
3
ENV PYTHONDONTWRITEBYTECODE=1 \
4
    PYTHONUNBUFFERED=1
5
 
6
WORKDIR /app
7
 
8
RUN useradd --create-home --uid 10001 appuser
9
 
10
COPY app/requirements.txt .
11
RUN pip install --no-cache-dir -r requirements.txt
12
 
13
COPY app/ .
14
 
15
USER appuser
16
 
17
EXPOSE 8080
18
 
19
HEALTHCHECK --interval=30s --timeout=3s CMD python -c "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8080/healthz').status==200 else 1)"
20
 
21
ENTRYPOINT ["gunicorn", "--bind", "0.0.0.0:8080", "--workers", "2", "main:app"]