Files
mtusi2026lab2/Dockerfile
T
2026-11-05 01:43:30 +03:00

15 lines
587 B
Docker

# syntax=docker/dockerfile:1
FROM python:3.12.12-slim-bookworm
WORKDIR /app
COPY requirements.txt .
RUN --mount=type=secret,id=proxy_ca \
if [ -f /run/secrets/proxy_ca ]; then export PIP_CERT=/run/secrets/proxy_ca; fi; \
pip install --no-cache-dir -r requirements.txt
COPY src ./src
COPY migrations ./migrations
COPY contracts ./contracts
RUN chmod -R a+rX /app && useradd --uid 10001 --create-home app
USER app
EXPOSE 8080
CMD ["sh", "-c", "python src/migrate.py && exec gunicorn --chdir src --bind 0.0.0.0:8080 --workers 1 --threads 4 --timeout 30 --access-logfile - app:app"]