mirror of
https://github.com/placeholder-soft/prodigyapi.git
synced 2026-01-12 22:44:57 +08:00
- 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>
29 lines
520 B
Docker
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"]
|