init commit: create skeleton from lab1
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
FROM python:3.12.15-slim-bookworm
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PIP_NO_CACHE_DIR=1 \
|
||||
PIP_DISABLE_PIP_VERSION_CHECK=1
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN useradd --system --uid 10001 --no-create-home appuser
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
COPY alembic.ini ./
|
||||
COPY migrations ./migrations
|
||||
COPY app ./app
|
||||
|
||||
USER appuser
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD ["python", "-c", "import os, urllib.request; urllib.request.urlopen('http://127.0.0.1:' + os.environ['APP_PORT'] + '/health/live', timeout=2)"]
|
||||
|
||||
CMD ["python", "-m", "app"]
|
||||
Reference in New Issue
Block a user