Skip to content

Commit

Permalink
Merge pull request #27 from alphagov/BUGFIX-run-app-in-venv
Browse files Browse the repository at this point in the history
BUGFIX Run application processes in a virtualenv
  • Loading branch information
benvand authored Jan 26, 2018
2 parents 279eebb + e5f417c commit 3d03c6b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.1
3.1.0
3 changes: 2 additions & 1 deletion api.docker
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ FROM digitalmarketplace/base

COPY nginx/api /etc/nginx/sites-enabled/api

ONBUILD RUN python -m venv venv
ONBUILD COPY requirements.txt ${APP_DIR}
ONBUILD RUN pip install --no-cache-dir -r requirements.txt
ONBUILD RUN venv/bin/pip install --no-cache-dir -r requirements.txt

ONBUILD COPY . ${APP_DIR}

Expand Down
2 changes: 1 addition & 1 deletion base.docker
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ENV YARN_VERSION 1.3.2-1
RUN apt-get update && \
apt-get install -y --no-install-recommends nginx \
libpcre3-dev libpq-dev libffi-dev libxml2-dev libxslt-dev python-setuptools libssl-dev \
gcc make git curl xz-utils python2.7 python-pip apt-transport-https gnupg && \
gcc make git curl xz-utils python2.7 python-pip python-virtualenv apt-transport-https gnupg && \
curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" && \
tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1 && \
rm "node-v$NODE_VERSION-linux-x64.tar.xz" && \
Expand Down
3 changes: 2 additions & 1 deletion frontend.docker
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ FROM digitalmarketplace/base

COPY nginx/frontend /etc/nginx/sites-enabled/frontend

ONBUILD RUN python -m venv venv
ONBUILD COPY requirements.txt ${APP_DIR}
ONBUILD RUN pip install --no-cache-dir -r requirements.txt
ONBUILD RUN venv/bin/pip install --no-cache-dir -r requirements.txt

ONBUILD COPY package.json ${APP_DIR}
ONBUILD COPY yarn.lock ${APP_DIR}
Expand Down
2 changes: 2 additions & 0 deletions uwsgi.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[uwsgi]
uid = www-data
gid = www-data

virtualenv = venv
module = application:application

socket = /run/uwsgi.sock
Expand Down

0 comments on commit 3d03c6b

Please sign in to comment.