Reorder Dockerfile to achieve faster rebuilds

This commit is contained in:
Bálint Bokros 2017-11-27 17:59:05 +01:00
parent c3e35cd549
commit 2d7d5228c8

View File

@ -10,19 +10,6 @@ RUN apt-get update && \
libreadline-dev \
libsqlite3-dev
ENV TFW_APP_DIR="/srv/app"
COPY src/app ${TFW_APP_DIR}
ENV TFW_COMPONENTS_DIR="/opt/components"
COPY src/components ${TFW_COMPONENTS_DIR}
ENV TFW_CONFIG_DIR="/usr/local/lib/"
ENV PYTHONPATH=${TFW_CONFIG_DIR}
COPY lib $TFW_CONFIG_DIR
ENV TFW_SUPERVISORD_CONF="/etc/supervisor/supervisord.conf"
COPY supervisord.conf ${TFW_SUPERVISORD_CONF}
USER user
COPY .pyenvrc /home/user/.pyenvrc
@ -37,6 +24,20 @@ RUN curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/p
ENV PYENV_ROOT="$HOME/.pyenv"
ENV PATH="$PYENV_ROOT/bin:$PATH"
ENV TFW_APP_DIR="/srv/app"
COPY src/app ${TFW_APP_DIR}
ENV TFW_COMPONENTS_DIR="/opt/components"
COPY src/components ${TFW_COMPONENTS_DIR}
# Copy config
ENV TFW_CONFIG_DIR="/usr/local/lib/"
ENV PYTHONPATH=${TFW_CONFIG_DIR}
COPY lib $TFW_CONFIG_DIR
ENV TFW_SUPERVISORD_CONF="/etc/supervisor/supervisord.conf"
COPY supervisord.conf ${TFW_SUPERVISORD_CONF}
ENV WEB_PORT=4242
EXPOSE 4242