Skip to content

Instantly share code, notes, and snippets.

@sreecodeslayer sreecodeslayer/Dockerfile
Last active Jul 5, 2019

Embed
What would you like to do?
Jekyll docker file and NGINX default configuration
# ============================================================
# Build your jekyll blog
# ============================================================
FROM jekyll/jekyll:stable AS build
RUN mkdir /jekyll-minima
WORKDIR /jekyll-minima
# copy the blog source
COPY . .
# permission for bundle to write gemfile.lock
RUN chmod 777 ./
# Install dependencies
RUN bundle install
# Build
RUN bundle exec jekyll build
# ============================================================
# Serve the build files with NGINX
# ============================================================
FROM nginx as nginx
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy build files of the blog
COPY --from=build /jekyll-minima/_site /usr/share/nginx/html
EXPOSE 80
server {
listen 80 default_server;
root /usr/share/nginx/html;
index index.html
# how long should static files be cached for,
# see http://nginx.org/en/docs/http/ngx_http_headers_module.html for options.
expires 1d;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.