-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
bennetrr
committed
Apr 10, 2024
1 parent
94bc7d2
commit 6cd0e67
Showing
1 changed file
with
21 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,31 @@ | ||
FROM python:3.12-slim | ||
|
||
# importing the action | ||
COPY ["src", "/action"] | ||
# Copy the action | ||
COPY ["src", "poetry.lock", "pyproject.toml", "/action/"] | ||
|
||
# installing the dependencies | ||
RUN pip install -r /action/requirements.txt | ||
# Install poetry | ||
# Thanks to Soof Golan and jjmerelo from StackOverflow: https://stackoverflow.com/a/72465422 | ||
ARG POETRY_VERSION=1.8.2 | ||
ENV POETRY_VENV=/opt/poetry-venv | ||
ENV POETRY_CACHE_DIR=/opt/.cache | ||
|
||
# Create a venv and install Poetry there | ||
RUN /usr/local/bin/python3.12 -m venv $POETRY_VENV | ||
RUN $POETRY_VENV/bin/python -m pip install -U pip setuptools | ||
RUN $POETRY_VENV/bin/python -m pip install poetry==${POETRY_VERSION} | ||
|
||
# Add Poetry to the PATH | ||
ENV PATH="${PATH}:${POETRY_VENV}/bin" | ||
|
||
RUN poetry -C /action install --no-interaction --no-cache --without dev | ||
|
||
# Print which git | ||
RUN echo "which git: $(which git)" | ||
|
||
# Install git | ||
RUN apt-get -yq update && apt-get -yq install git && rm -rf /var/lib/apt/lists/* | ||
RUN apt-get -yq update && \ | ||
apt-get -yq install git && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN chmod +x /action/entrypoint.sh | ||
|
||
# Set the entrypoint | ||
ENTRYPOINT ["/action/entrypoint.sh"] | ||
ENTRYPOINT ["poetry", "-C", "/action", "run", "/action/entrypoint.sh"] |