-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (28 loc) · 906 Bytes
/
Dockerfile
File metadata and controls
39 lines (28 loc) · 906 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
34
35
36
37
38
39
FROM python:3.10-alpine as build
ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \
POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_IN_PROJECT=true \
POETRY_NO_INTERACTION=1 \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
WORKDIR /opt/build
# Install poetry
RUN apk add --no-cache poetry
# Install package dependencies
COPY pyproject.toml poetry.lock ./
RUN poetry env use /usr/local/bin/python3 && \
poetry install --no-root --no-dev
# Install package
COPY src ./src
RUN poetry install --no-dev
FROM python:3.10-alpine
WORKDIR /opt/action
RUN apk add --no-cache git
# Copy the package
COPY --from=build /opt/build/.venv ./.venv
# Normally we'd copy this into workdir, but GitHub hardcodes it
COPY --from=build /opt/build/src ./.venv/lib/python3.10/site-packages/
# "Activate" the venv
ENV PATH="/opt/action/.venv/bin:${PATH}"
# Entrypoint
CMD ["python3", "-m", "dalamud_plugin_pr2"]