-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (22 loc) · 736 Bytes
/
Dockerfile
File metadata and controls
33 lines (22 loc) · 736 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
28
29
30
31
32
33
FROM python:3.13-alpine
# no pyc files
ENV PYTHONDONTWRITEBYTECODE=1
# no buffering stdout and stderr
ENV PYTHONUNBUFFERED=1
WORKDIR /pyzk_api
RUN apk add --no-cache \
build-base \
&& rm -rf /var/cache/apk/*
RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=bind,source=requirements.txt,target=requirements.txt \
python -m pip install -r requirements.txt
RUN addgroup -g 1001 -S appgroup && \
adduser -u 1001 -S appuser -G appgroup
COPY . .
# Create logs directory with proper permissions
RUN mkdir -p /tmp/logs && \
chown -R appuser:appgroup /tmp/logs && \
chown -R appuser:appgroup /pyzk_api
USER appuser
EXPOSE 9000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "9000"]