-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (25 loc) · 1.17 KB
/
Copy pathDockerfile
File metadata and controls
33 lines (25 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
WORKDIR /app
RUN groupadd --gid 10001 proofmesh \
&& useradd --uid 10001 --gid 10001 --no-create-home --shell /usr/sbin/nologin proofmesh
COPY requirements.txt requirements-production.txt requirements-production.lock pyproject.toml README.md ./
COPY src ./src
ARG PROOFMESH_INSTALL_PROFILE=development
RUN if [ "$PROOFMESH_INSTALL_PROFILE" = "production" ]; then \
pip install --no-cache-dir --require-hashes -r requirements-production.lock; \
else \
pip install --no-cache-dir -r requirements.txt; \
fi \
&& pip install --no-cache-dir --no-deps .
COPY data ./data
COPY config ./config
RUN mkdir -p /app/var /app/artifacts /app/config/trust \
&& chown -R proofmesh:proofmesh /app/var /app/artifacts /app/config/trust
USER 10001:10001
EXPOSE 8000
HEALTHCHECK --interval=15s --timeout=3s --start-period=10s --retries=3 \
CMD ["python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=2).read()"]
CMD ["uvicorn", "proofmesh.api:app", "--host", "0.0.0.0", "--port", "8000", "--no-server-header"]