-
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.
Update actions/setup-python to use pyproject.toml (#208)
- Loading branch information
1 parent
5074f8b
commit c393f7b
Showing
4 changed files
with
27 additions
and
33 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
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,4 +1,4 @@ | ||
FROM python:3.12 | ||
FROM python:3.12.1 | ||
LABEL maintainer "ODL DevOps <[email protected]>" | ||
|
||
# Add package files, install updated node and pip | ||
|
@@ -19,27 +19,39 @@ RUN mkdir /src | |
RUN adduser --disabled-password --gecos "" mitodl | ||
RUN mkdir /var/media && chown -R mitodl:mitodl /var/media | ||
|
||
# Poetry env configuration | ||
## Set some poetry config | ||
ENV \ | ||
# poetry: | ||
POETRY_VERSION=1.5.1 \ | ||
POETRY_VIRTUALENVS_CREATE=false \ | ||
POETRY_CACHE_DIR='/tmp/cache/poetry' | ||
POETRY_VERSION=1.7.1 \ | ||
POETRY_VIRTUALENVS_CREATE=true \ | ||
POETRY_CACHE_DIR='/tmp/cache/poetry' \ | ||
POETRY_HOME='/home/mitodl/.local' \ | ||
VIRTUAL_ENV="/opt/venv" | ||
ENV PATH="$VIRTUAL_ENV/bin:$POETRY_HOME/bin:$PATH" | ||
|
||
# Install poetry | ||
RUN pip install "poetry==$POETRY_VERSION" | ||
|
||
# Install project packages | ||
COPY pyproject.toml /src | ||
COPY poetry.lock /src | ||
COPY mitol_django_*.gz /src | ||
RUN chown -R mitodl:mitodl /src | ||
RUN mkdir ${VIRTUAL_ENV} && chown -R mitodl:mitodl ${VIRTUAL_ENV} | ||
|
||
## Install poetry itself, and pre-create a venv with predictable name | ||
USER mitodl | ||
RUN curl -sSL https://install.python-poetry.org \ | ||
| \ | ||
POETRY_VERSION=${POETRY_VERSION} \ | ||
POETRY_HOME=${POETRY_HOME} \ | ||
python3 -q | ||
WORKDIR /src | ||
RUN python3 -m venv $VIRTUAL_ENV | ||
RUN poetry install | ||
|
||
# Add project | ||
USER root | ||
COPY . /src | ||
WORKDIR /src | ||
RUN chown -R mitodl:mitodl /src | ||
RUN mkdir /src/staticfiles | ||
|
||
USER mitodl | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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