feat(lab5): implement reliable image pipeline and track 2
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
FROM python:3.11.16-slim-bookworm
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV APP_HOST=0.0.0.0
|
||||
ENV APP_PORT=8080
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
|
||||
RUN python -m pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
RUN useradd --uid 10001 --create-home --shell /usr/sbin/nologin appuser
|
||||
|
||||
COPY --chown=appuser:appuser src/ ./src/
|
||||
|
||||
COPY --chown=appuser:appuser db/ ./db/
|
||||
|
||||
COPY --chown=appuser:appuser contracts/openapi.json ./contracts/openapi.json
|
||||
|
||||
COPY infra/app-start.sh /usr/local/bin/app-start
|
||||
ENTRYPOINT ["/bin/sh", "/usr/local/bin/app-start"]
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
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.getenv('APP_PORT', '8080') + '/health/ready', timeout=2).read()"
|
||||
|
||||
CMD ["python", "-m", "uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8080", "--timeout-graceful-shutdown", "4", "--timeout-keep-alive", "2", "--limit-concurrency", "64"]
|
||||
Reference in New Issue
Block a user