Skip to content

Commit

Permalink
Use a venv
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Sep 2, 2024
1 parent 671b1a5 commit 951b983
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ RUN --mount=type=cache,target=/var/lib/apt/lists \
fonts-dejavu \
optipng jpegoptim \
postgresql-client net-tools iputils-ping \
python3-pip
python3-pip python3-venv \
&& python3 -m venv /venv

ENV PATH=/venv/bin:$PATH

# Used to convert the locked packages by poetry to pip requirements format
# We don't directly use `poetry install` because it force to use a virtual environment.
Expand Down Expand Up @@ -47,8 +50,8 @@ RUN --mount=type=cache,target=/var/lib/apt/lists \
&& apt-get update \
&& apt-get install --assume-yes --no-install-recommends ${DEV_PACKAGES} \
&& python3 -m pip install --disable-pip-version-check --no-deps --requirement=/poetry/requirements.txt \
&& python3 -m compileall /usr/local/lib/python* /usr/lib/python* \
&& strip /usr/local/lib/python*/dist-packages/shapely/*.so \
&& python3 -m compileall /venv/lib/python* /usr/lib/python* \
&& strip /venv/lib/python*/dist-packages/shapely/*.so \
&& apt-get remove --purge --autoremove --yes ${DEV_PACKAGES} binutils

# From c2cwsgiutils
Expand Down

0 comments on commit 951b983

Please sign in to comment.