-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (24 loc) · 816 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
30
# using ruby:latest
# naming this stage as jekyll-build
FROM ruby as jekyll-build
# Install bundler gem
RUN gem install bundler
# Set the working directory for subsequent
# RUN, CMD, ADD, COPY and ENTRYPOINT commands
WORKDIR /work
# Copy Gemfile into /work and run bundle install
# to install the required dependencies
COPY Gemfile* /work/
RUN bundle install
# Copy the root contents into /work
COPY . .
# Set necessary environment variables for the build
# and fire off the build
ENV JEKYLL_ENV=production
RUN bundle exec jekyll build
# Now that _site is built in /work directory, take it from
# jekyll-build stage and put it into /usr/share/nginx/html
# of the nginx image
FROM nginx
COPY --from=jekyll-build /work/_site /usr/share/nginx/html
COPY _app/etc/nginx/default.conf /etc/nginx/conf.d/default.conf