Add second lab code

This commit is contained in:
2026-10-23 15:12:43 +03:00
parent 0ab3a341aa
commit cd9c3402fa
40 changed files with 1692 additions and 10 deletions
+29
View File
@@ -0,0 +1,29 @@
FROM python:3.12.8-slim-bookworm
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
APP_HOST=0.0.0.0 \
APP_PORT=8080
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY contracts ./contracts
COPY src ./src
COPY migrations ./migrations
COPY tests ./tests
COPY student-tests ./student-tests
COPY scripts ./scripts
COPY lab.json .
RUN useradd --create-home --shell /usr/sbin/nologin appuser
USER appuser
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD python -c "import os, urllib.request; urllib.request.urlopen('http://127.0.0.1:' + os.getenv('APP_PORT', '8080') + '/health/ready', timeout=2).read()"
STOPSIGNAL SIGTERM
CMD ["python", "-m", "src"]