Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mfenner committed Mar 22, 2024
1 parent 9d49f77 commit 62876e2
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@
ARG BUILDPLATFORM=linux/amd64
FROM --platform=$BUILDPLATFORM python:3.12-bookworm as builder

ENV PANDOC_VERSION=3.1.12.3
ENV POETRY_VERSION=1.8.2

# Update installed APT packages
RUN apt-get update && apt-get upgrade -y && \
apt-get install wget weasyprint -y && \
wget -q https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-1-amd64.deb && \
dpkg -i pandoc-${PANDOC_VERSION}-1-amd64.deb && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN pip install poetry==${POETRY_VERSION}

ENV POETRY_NO_INTERACTION=1 \
Expand All @@ -27,13 +19,22 @@ RUN touch README.md
RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --without dev --no-root


FROM python:3.12-slim-bookworm as runtime
FROM --platform=$BUILDPLATFORM python:3.12-slim-bookworm as runtime

ENV VIRTUAL_ENV=/app/.venv \
PATH="/app/.venv/bin:$PATH"
PATH="/app/.venv/bin:$PATH" \
PANDOC_VERSION=3.1.12.3

COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}

# Update installed APT packages
RUN apt-get update && apt-get upgrade -y && \
apt-get install wget weasyprint -y && \
wget -q https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-1-amd64.deb && \
dpkg -i pandoc-${PANDOC_VERSION}-1-amd64.deb && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

WORKDIR /app
COPY api ./api
COPY pandoc ./pandoc
COPY hypercorn.toml ./
Expand Down

0 comments on commit 62876e2

Please sign in to comment.