forked from openstreetmap/stateofthemap-2021
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.prod
35 lines (24 loc) · 839 Bytes
/
Dockerfile.prod
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
31
32
33
34
35
# This file is used if building for Production environments
# It uses a multi-stage build to run jekyll to populate an nginx container
FROM ruby:2.6-alpine as build
# Add Gem build requirements
RUN apk add --no-cache g++ make
# Create app directory
WORKDIR /app
# Add Gemfile and Gemfile.lock
ADD Gemfile* /app/
# Install Gems
RUN gem install bundler -v 2.1.4 \
&& bundle config build.nokogiri --use-system-libraries \
&& bundle config --global jobs $(nproc) \
&& bundle install --deployment --no-cache \
&& bundle clean
# Copy Site Files
COPY . .
ENV JEKYLL_ENV=production
# Run jekyll build site
RUN bundle exec jekyll build --verbose
#-------------------------------------------------
FROM nginx:stable-alpine as webserver
# Copy built site from build stage
COPY --from=build /app/_site /usr/share/nginx/html