Skip to content

Commit

Permalink
Improved docker build correctness and build speed
Browse files Browse the repository at this point in the history
  • Loading branch information
rjsparks committed Jun 5, 2019
1 parent 80e629a commit 94fe542
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
FROM opensuse/leap

RUN zypper -n update

RUN zypper -n install \
RUN zypper -n update && zypper -n install \
apache2 \
apache2-devel \
gcc \
Expand All @@ -18,6 +16,11 @@ EXPOSE 8001:8001

RUN mkdir /code
WORKDIR /code

# Doing this step before copying the whole codebase improves docker's ability to reuse cached layers at build time
COPY --chown=wwwrun:www ./requirements.txt /code/requirements.txt
RUN pip install -r requirements.txt

COPY --chown=wwwrun:www . /code/

RUN mkdir /code/static
Expand All @@ -26,7 +29,6 @@ RUN chown wwwrun:www /code/static
RUN mkdir /code/logs
RUN chown wwwrun:www /code/logs

RUN pip install -r requirements.txt

RUN echo "SECRET_KEY='garbage'" > ietf/settings/local.py
ENV DJANGO_SETTINGS_MODULE=ietf.settings.production
Expand Down

0 comments on commit 94fe542

Please sign in to comment.