Skip to content

Commit

Permalink
Merge pull request #290 from kjsanger/bug/clean-paths
Browse files Browse the repository at this point in the history
Set a clean PATH and PYTHONPATH
  • Loading branch information
kjsanger authored Apr 15, 2024
2 parents 1750d14 + 64df097 commit 0a626d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ WORKDIR /app
COPY . .

ENV PYENV_ROOT "/app/.pyenv"
ENV PATH "${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"

# Put PYENV first to ensure we use the pyenv-installed Python
ENV PATH "${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"

RUN ./docker/install_pyenv.sh

Expand All @@ -49,8 +51,11 @@ RUN echo "debconf debconf/frontend select Noninteractive" | debconf-set-selectio
unattended-upgrade -d -v

ENV PYENV_ROOT "/app/.pyenv"
ENV PATH "${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"

# Put PYENV first to ensure we use the pyenv-installed Python
ENV PATH "${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
ENV PYTHONUNBUFFERED 1
ENV PYTHONPATH ""

WORKDIR /app

Expand Down
5 changes: 4 additions & 1 deletion docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
set -e

export PYENV_ROOT="/app/.pyenv"
export PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"

# Put PYENV first to ensure we use the pyenv-installed Python
export PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:/bin:/usr/bin:/usr/local/bin"
export PYTHONUNBUFFERED=1
export PYTHONPATH=""

exec "$@"

0 comments on commit 0a626d8

Please sign in to comment.