Last active
July 5, 2019 12:20
-
-
Save sreecodeslayer/629e8f67b7ec373b1b6cf9be9867d6f3 to your computer and use it in GitHub Desktop.
Jekyll docker file and NGINX default configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ============================================================ | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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