DummyApp/Dockerfile
Norvicdev f1e3f4defc
All checks were successful
Build and Deploy Flask App / setup (push) Successful in 2s
Build and Deploy Flask App / test (push) Successful in 35s
Build and Deploy Flask App / build-and-push (push) Successful in 1m10s
Build and Deploy Flask App / deploy (push) Successful in 38s
test runner - fix v13
2026-08-05 09:17:58 +03:00

21 lines
No EOL
677 B
Docker

FROM python:3.12-slim
WORKDIR /app
# Ставим зависимости глобально (доступно всем пользователям)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Копируем код
COPY . .
# Создаём пользователя и даём права на /app
RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
USER appuser
EXPOSE 5000
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:5000/health')" || exit 1
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "4", "run:app"]