Files
prodigyapi/Dockerfile
Michael Bang 779658de7b 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>
2020-10-26 14:31:15 -04:00

29 lines
520 B
Docker

FROM ruby:2.6-slim
WORKDIR /srv/slate
VOLUME /srv/slate/build
VOLUME /srv/slate/source
EXPOSE 4567
COPY Gemfile .
COPY Gemfile.lock .
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
nodejs \
&& gem install bundler \
&& bundle install \
&& apt-get remove -y build-essential \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
COPY . /srv/slate
RUN chmod +x /srv/slate/slate.sh
ENTRYPOINT ["/srv/slate/slate.sh"]
CMD ["build"]