-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (37 loc) · 1.76 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (37 loc) · 1.76 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM ghcr.io/ds-wizard/python-base:4.32.0-docworker AS builder
ARG TARGETARCH
WORKDIR /app
COPY --from=ghcr.io/astral-sh/uv:0.11.28 /uv /bin/uv
COPY . /app
RUN apk add -u build-base gcc font-noto-emoji \
&& clean
RUN uv export --frozen --no-dev --no-emit-workspace --no-hashes --package dsw-document-worker -o /app/requirements.txt \
&& python -m pip wheel --wheel-dir=/app/wheels -r /app/requirements.txt \
&& python -m pip wheel --no-deps --wheel-dir=/app/wheels /app/packages/dsw-command-queue \
&& python -m pip wheel --no-deps --wheel-dir=/app/wheels /app/packages/dsw-config \
&& python -m pip wheel --no-deps --wheel-dir=/app/wheels /app/packages/dsw-database \
&& python -m pip wheel --no-deps --wheel-dir=/app/wheels /app/packages/dsw-storage \
&& python -m pip wheel --no-deps --wheel-dir=/app/wheels /app/packages/dsw-document-worker/addons/* \
&& python -m pip wheel --no-deps --wheel-dir=/app/wheels /app/packages/dsw-document-worker
FROM ghcr.io/ds-wizard/python-base:4.32.0-docworker
ENV APPLICATION_CONFIG_PATH=/app/config/application.yml \
WORKDIR_PATH=/tmp/docworker \
PATH="/home/user/.local/bin:$PATH"
# Add fonts
COPY packages/dsw-document-worker/resources/fonts /usr/share/fonts/truetype/custom
RUN fc-cache
# Add Pandoc filters
COPY packages/dsw-document-worker/resources/pandoc/filters /pandoc/filters
RUN fc-cache
# Use non-root user
USER user
# Prepare dirs
WORKDIR /home/user
RUN mkdir -p /home/user/templates
COPY --chown=user:user packages/dsw-document-worker/data /home/user/data
# Install Python packages
COPY --from=builder --chown=user:user /app/wheels /home/user/wheels
RUN python -m pip install --break-system-packages --user --no-cache --no-index /home/user/wheels/* \
&& rm -rf /home/user/wheels
# Run
CMD ["dsw-document-worker", "run"]