-
Notifications
You must be signed in to change notification settings - Fork 42
/
Dockerfile
47 lines (31 loc) · 841 Bytes
/
Dockerfile
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
# -- Base image --
FROM python:3.12-slim as base
MAINTAINER Julien Maupetit <[email protected]>
# Upgrade pip to its latest release to speed up dependencies installation
RUN pip install --upgrade pip
# Upgrade system packages to install security updates
RUN apt update && \
apt -y upgrade && \
apt install -y libpango-1.0-0 libpangoft2-1.0-0 && \
rm -rf /var/lib/apt/lists/*
# -- Builder --
FROM base as builder
WORKDIR /build
COPY . /build/
ENV PATH $PATH:/root/.local/bin
# Install poetry
RUN pip install pipx && \
pipx install poetry
# Build and install md2pdf
RUN poetry build && \
pip install dist/*.whl
# -- Core --
FROM base as core
COPY --from=builder /usr/local /usr/local
# -- App --
FROM core as production
VOLUME ["/app"]
WORKDIR /app
USER "1000:1000"
ENV HOME="/tmp"
ENTRYPOINT ["md2pdf"]