-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
32 lines (22 loc) · 954 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
ARG PYTHON_BASE=3.12-slim
FROM python:${PYTHON_BASE} AS builder
# disable update check since we're "static" in an image
ENV PDM_CHECK_UPDATE=false
# install PDM
RUN pip install -U pdm
WORKDIR /project
RUN --mount=type=cache,target=/project/.venv/,sharing=locked \
--mount=type=bind,source=pyproject.toml,target=/project/pyproject.toml,readwrite \
--mount=type=bind,source=pdm.lock,target=/project/pdm.lock,readwrite \
pdm install --check --prod --no-editable && \
cp -R /project/.venv /project/.ready-venv
FROM python:${PYTHON_BASE}
LABEL org.opencontainers.image.source=https://github.com/abstractumbra/anilistcmp
LABEL org.opencontainers.image.description="Anilist 'planning' Comparison tool"
LABEL org.opencontainers.image.licenses="MPL-2.0"
USER 1000:1000
WORKDIR /app
COPY --from=builder --chown=1000:1000 /project/.ready-venv/ /app/.venv
ENV PATH="/app/.venv/bin:$PATH"
COPY . /app/
ENTRYPOINT ["python", "-O", "main.py"]