Skip to content

Commit 5329685

Browse files
authored
Merge pull request #351 from ImperialCollegeLondon/virtual-env-activation
Permanently activate venv in Docker image environment
2 parents 61ec955 + b6ef5ed commit 5329685

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@
1212
!assets
1313
!test_data
1414
test_data/10.14469_hpc_*
15-
!docker/entrypoint.sh

Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ RUN chgrp -R 0 ${WORKING_DIR} && \
8888
COPY site ./site
8989
COPY Pipfile Pipfile.lock ./
9090
RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy --extra-pip-args="--no-cache-dir"
91+
ENV VIRTUAL_ENV_PATH=${WORKING_DIR}/src/.venv
92+
ENV PATH="$VIRTUAL_ENV_PATH/bin:$PATH" \
93+
PYTHONUNBUFFERED=1 \
94+
PYTHONDONTWRITEBYTECODE=1 \
95+
PYTHONNOUSERSITE=1
9196

9297
COPY ./docker/uwsgi/ ${INVENIO_INSTANCE_PATH}
9398
COPY ./invenio.cfg ${INVENIO_INSTANCE_PATH}
@@ -98,12 +103,8 @@ COPY ./ .
98103

99104
RUN cp -r ./static/. ${INVENIO_INSTANCE_PATH}/static/ && \
100105
cp -r ./assets/. ${INVENIO_INSTANCE_PATH}/assets/ && \
101-
/opt/invenio/src/.venv/bin/invenio collect --verbose && \
102-
/opt/invenio/src/.venv/bin/invenio webpack buildall && \
106+
invenio collect --verbose && \
107+
invenio webpack buildall && \
103108
npm cache clean --force
104109

105110
RUN chown -R invenio test_data/ ${INVENIO_INSTANCE_PATH}/app_data/
106-
COPY ./docker/entrypoint.sh /usr/local/bin/entrypoint.sh
107-
108-
RUN chmod +x /usr/local/bin/entrypoint.sh
109-
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

docker/entrypoint.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)