-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (20 loc) · 939 Bytes
/
Copy pathDockerfile
File metadata and controls
27 lines (20 loc) · 939 Bytes
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
FROM ghcr.io/astral-sh/uv:python3.13-alpine
RUN addgroup -g 1001 -S snykey && \
adduser -u 1001 -S snykey -G snykey
COPY snykey /snykey
RUN mkdir -p /snykey/logs /snykey/certs /snykey/certs/ca && \
chown -R snykey:snykey /snykey
WORKDIR /snykey
# Install dependencies and clean up (just in case)
RUN uv pip install --system --no-cache-dir -r requirements.txt \
&& rm requirements.txt \
&& mkdir -p /snykey/logs /snykey/certs /snykey/certs/ca \
&& find /snykey -type d -name '__pycache__' -exec rm -rf {} + \
&& rm -rf /usr/local/lib/python*/site-packages/pip* /usr/local/bin/pip* \
&& rm -rf /root/.cache/pip /tmp/pip-*
USER snykey
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", \
"--log-config", "/snykey/logging_config.yaml", \
"--ssl-keyfile", "/snykey/certs/app.key", \
"--ssl-certfile", "/snykey/certs/app.crt", \
"--ssl-ca-certs", "/snykey/certs/ca/ca.crt"]