From 6b6f4942c07dc6e9cb86878a5ae6151abd5e117e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Wed, 24 Jan 2018 13:46:27 +0100 Subject: [PATCH] Reorder of Dockerfile for painless configuration of envvars --- Dockerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 36e3525..496941a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,6 +35,12 @@ RUN curl -fSL -o pyenv-installer ${PYENV_INSTALLER_URL} &&\ pyenv global ${PYTHON_VERSION} &&\ pip install tornado pyzmq transitions +USER root +WORKDIR /data/ +COPY src/frontend /data/ +RUN yarn install --frozen-lockfile +RUN yarn build --no-progress + ENV TFW_WEB_PORT=4242 ENV TFW_LOGIN_APP_PORT=6666 ENV TFW_PUBLIC_PORT=8888 @@ -52,18 +58,12 @@ ENV TFW_SUPERVISORD_CONF="/etc/supervisor/supervisord.conf" ENV PYTHONPATH=${TFW_LIB_DIR} -USER root COPY src/nginx /etc/nginx RUN chown -R ${AVATAO_USER}: /var/log/nginx /var/lib/nginx && \ # nginx runs as a regular user, and can't write to /run sed -i 's#pid /run/nginx.pid;#pid /tmp/nginx.pid;#g' /etc/nginx/nginx.conf && \ envsubst "$(printenv | cut -d= -f1 | grep TFW_ | sed -e 's/^/$/g')" \ - < /etc/nginx/sites-available/default > /etc/nginx/sites-available/default - -WORKDIR /data/ -COPY src/frontend /data/ -RUN yarn install --frozen-lockfile -RUN yarn build --no-progress && \ + < /etc/nginx/sites-available/default > /etc/nginx/sites-available/default &&\ mv /data/dist ${TFW_FRONTEND_DIR} USER ${AVATAO_USER}