mirror of
https://github.com/placeholder-soft/prodigyapi.git
synced 2026-01-12 22:44:57 +08:00
Dockerfile: allow Docker to cache build steps (#1336)
- By having a `COPY . xx` step before installing dependencies, we rob Docker of the opportunity to cache downloading and building dependencies if we make any changes to any files in the repository. By copying only Gemfiles before the build step, we only require Docker to rebuild dependencies when the Gemfiles have changed. Co-authored-by: Matthew Peveler <matt.peveler@gmail.com>
This commit is contained in:
10
Dockerfile
10
Dockerfile
@@ -7,7 +7,8 @@ VOLUME /srv/slate/source
|
||||
|
||||
EXPOSE 4567
|
||||
|
||||
COPY . /srv/slate
|
||||
COPY Gemfile .
|
||||
COPY Gemfile.lock .
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
@@ -17,8 +18,11 @@ RUN apt-get update \
|
||||
&& bundle install \
|
||||
&& apt-get remove -y build-essential \
|
||||
&& apt-get autoremove -y \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& chmod +x /srv/slate/slate.sh
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY . /srv/slate
|
||||
|
||||
RUN chmod +x /srv/slate/slate.sh
|
||||
|
||||
ENTRYPOINT ["/srv/slate/slate.sh"]
|
||||
CMD ["build"]
|
||||
|
||||
Reference in New Issue
Block a user