#Dockerfile

FROM jekyll/builder AS build

# Use /tmp because jekyll's docker image mounts a volume at /srv/jekyll which
# is deleted when the intermediate container is removed during build
WORKDIR /tmp

# Install dependencies
COPY Gemfile Gemfile*.lock /tmp/
RUN chmod a+w /tmp/Gemfile.lock
RUN bundle install

# Generate the jekyll site
COPY . /tmp
ENV JEKYLL_ENV=production
RUN jekyll build --verbose

# Copy generated assets to nginx container
FROM nginx:alpine as production
COPY --from=build /tmp/_site/ /usr/share/nginx/html/

EXPOSE 80
