-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (23 loc) · 781 Bytes
/
Dockerfile
File metadata and controls
33 lines (23 loc) · 781 Bytes
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
FROM python:3.10.9-slim as base
LABEL org.opencontainers.image.source="https://github.com/null2264/SpeedrunBot"
LABEL org.opencontainers.image.description="A Discord Bot created for Obscure Minecraft Speedrunning Discord Server"
LABEL org.opencontainers.image.licenses=Unlicense
ENV PATH="/venv/bin:/root/.local/bin:${PATH}" \
VIRTUAL_ENV="/venv"
# ---
FROM base as builder
WORKDIR /app
RUN apt-get update && apt-get install -y patch git
RUN pip install -U pip setuptools wheel
RUN pip install pdm
RUN python -m venv /venv
COPY pyproject.toml pdm.lock LICENSE ./
ADD src/ ./src
RUN pdm sync --prod --no-editable
# ---
FROM base as final
WORKDIR /app
COPY --from=builder /venv /venv
COPY --from=builder /app/src/ /app/src/
COPY main.py /app/
CMD ["python", "main.py"]