This commit is contained in:
2026-09-30 12:13:29 +03:00
parent 6bc82eaa2a
commit f4198de3c8
45 changed files with 4027 additions and 875 deletions
+8 -12
View File
@@ -2,23 +2,19 @@ FROM python:3.12.7-slim
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY app/ ./app/
RUN useradd --create-home --shell /usr/sbin/nologin appuser \
&& chown -R appuser:appuser /app
COPY app ./app
COPY scripts ./scripts
COPY migrations ./migrations
RUN useradd --create-home --uid 10001 appuser
USER appuser
ENV APP_HOST=0.0.0.0
ENV APP_PORT=8080
ENV LOG_LEVEL=info
EXPOSE 8080
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \
CMD python -c "import sys, urllib.request; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8080/health/live', timeout=2).status == 200 else 1)"
CMD ["sh", "-c", "exec uvicorn app.main:app --host ${APP_HOST} --port ${APP_PORT} --log-level ${LOG_LEVEL}"]
CMD ["sh", "-c", "uvicorn app.main:app --host ${APP_HOST:-0.0.0.0} --port ${APP_PORT:-8080}"]