-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathlambda.Dockerfile
More file actions
48 lines (35 loc) · 1.9 KB
/
Copy pathlambda.Dockerfile
File metadata and controls
48 lines (35 loc) · 1.9 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
FROM ghcr.io/ds-wizard/python-base:4.32.0-docworker-lambda AS builder
COPY --from=ghcr.io/astral-sh/uv:0.11.28 /uv /bin/uv
COPY . /app
# Install Python dependencies (resolved from uv.lock)
RUN uv --directory /app 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-lambda
ARG LAMBDA_TASK_ROOT
ENV APPLICATION_CONFIG_PATH=${LAMBDA_TASK_ROOT}/application.yml \
WORKDIR_PATH=/tmp/docworker \
EXPERIMENTAL_PDF_WATERMARK=${LAMBDA_TASK_ROOT}/data/watermark.pdf
# 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
WORKDIR ${LAMBDA_TASK_ROOT}
# Prepare dirs
RUN mkdir /tmp/docworker
COPY packages/dsw-document-worker/data ./data
# Copy Python dependencies
COPY --from=builder /app/wheels /tmp/wheels
RUN python -m pip install --no-cache --no-index /tmp/wheels/* \
&& rm -rf /tmp/wheels
# Copy the Lambda handler
COPY packages/dsw-document-worker/resources/lambda_handler.py ${LAMBDA_TASK_ROOT}
# Pass the name of the function handler as an argument to the runtime
ENTRYPOINT [ "python", "-m", "awslambdaric" ]
CMD [ "lambda_handler.handler" ]