diff --git a/python-minimal/Dockerfile b/python-minimal/Dockerfile index 391b05d0..b636e663 100644 --- a/python-minimal/Dockerfile +++ b/python-minimal/Dockerfile @@ -23,8 +23,6 @@ RUN /opt/install-conda.sh && \ conda env update -n base -f conda-env.yml && \ # Install duckdb extensions conda run -n base python /opt/install-duckdb-extensions.py && \ - # Activate custom Conda env by default in shell - echo ". ${CONDA_DIR}/etc/profile.d/conda.sh && conda activate" >> ${HOME}/.bashrc && \ # Fix permissions chown -R ${USERNAME}:${GROUPNAME} ${HOME} ${CONDA_DIR} && \ # Clean diff --git a/scripts/onyxia-init.sh b/scripts/onyxia-init.sh index 64693e5d..b028a289 100644 --- a/scripts/onyxia-init.sh +++ b/scripts/onyxia-init.sh @@ -226,5 +226,10 @@ if [[ -n "$PERSONAL_INIT_SCRIPT" ]]; then curl $PERSONAL_INIT_SCRIPT | bash -s -- $PERSONAL_INIT_ARGS fi +# Activate Conda env by default in shell except if specified otherwise +if [[ "$CUSTOM_PYTHON_ENV" != "true" ]]; then +echo ". ${CONDA_DIR}/etc/profile.d/conda.sh && conda activate" >> ${HOME}/.bashrc ; +fi + echo "execution of $@" exec "$@"