forked from spack/spack.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
29 lines (22 loc) · 806 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# use standard ruby build image
FROM ruby as build-env
WORKDIR /build
# Set default locale for the environment
ENV LC_ALL C.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV JEKYLL_ENV production
RUN gem update --system
# first install w/o copying in files, so we can cache dependencies in a layer
# `bundle install` can take a while.
COPY Gemfile .
RUN bundle install
# copy everything in but keep the Gemfile.lock from the original install
# Note that Gemfile.lock is in .dockerignore
COPY . ./
# Now do the much quicker Jekyll build
RUN bundle exec jekyll build --verbose
# use a lightweight run image and copy everything from the build image into it
FROM nginx:mainline-alpine
COPY --from=build-env --chown=nginx:nginx /build/_site /usr/share/nginx/html
CMD ["nginx", "-g", "daemon off;"]