-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.dev
More file actions
29 lines (23 loc) · 891 Bytes
/
Dockerfile.dev
File metadata and controls
29 lines (23 loc) · 891 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
FROM python:3.13-alpine AS builder
WORKDIR /app
COPY . /app/src
RUN cd /app/src && pip install --no-cache-dir --root /app/packages . && \
cp /app/src/tests/_test_encryption.py /app/_test_encryption.py && \
rm -rf /app/src && \
# Remove all __pycache__ directories from /usr/local/lib
find /usr/local/lib -name __pycache__ -exec rm -rf {} +
FROM python:3.13-alpine
# Define build arguments
ARG EXTRA_PACKAGES=""
ARG UID=1000
WORKDIR /app
RUN apk add --no-cache gpg gpg-agent ${EXTRA_PACKAGES} && \
rm -rf /var/cache/apk/* && \
mkdir logs config && \
echo "nonroot:x:${UID}:${UID}:nonroot:/home/nonroot:/bin/sh" >> /etc/passwd && \
echo "nonroot:x:${UID}:" >> /etc/group && \
chown -R nonroot:nonroot logs
COPY --from=builder /app/_test_encryption.py /app/_test_encryption.py
COPY --from=builder /app/packages /
USER nonroot
ENTRYPOINT [ "task-run" ]