forked from mtusi2026/mtusi2026lab3
12 lines
518 B
Docker
12 lines
518 B
Docker
FROM python:3.12.7-slim-bookworm
|
|
WORKDIR /srv
|
|
COPY app/requirements.txt app/requirements.txt
|
|
RUN pip install --no-cache-dir -r app/requirements.txt && useradd --uid 10001 --create-home app
|
|
COPY app app
|
|
COPY migrations migrations
|
|
USER 10001:10001
|
|
ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1
|
|
EXPOSE 8080
|
|
HEALTHCHECK --interval=5s --timeout=4s --start-period=20s CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8080/health/ready', timeout=3)" || exit 1
|
|
CMD ["python", "app/server.py"]
|