forked from mtusi2026/mtusi2026lab4
Co-authored-by: Югай Артур Рустамович <f1ekserr@yandex.ru>
16 lines
689 B
Docker
16 lines
689 B
Docker
FROM python:3.13.14-slim-bookworm@sha256:67a1e1f215ccda113cfc024e8639049257e88f273898f595b61476d128d387e8
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 PYTHONUTF8=1 \
|
|
APP_HOST=0.0.0.0 APP_PORT=8080 APP_ENV=lab
|
|
WORKDIR /app
|
|
COPY requirements.lock .
|
|
RUN python -m pip install --no-cache-dir -r requirements.lock \
|
|
&& useradd --uid 10001 --create-home messenger
|
|
COPY src ./src
|
|
COPY migrations ./migrations
|
|
USER messenger
|
|
EXPOSE 8080
|
|
HEALTHCHECK --interval=5s --timeout=4s --start-period=10s --retries=6 \
|
|
CMD python -c "import os,urllib.request; urllib.request.urlopen('http://127.0.0.1:'+os.environ['APP_PORT']+'/health/ready',timeout=3).close()"
|
|
CMD ["python", "-m", "src"]
|