Created
July 15, 2023 22:10
-
-
Save zsmahi/d1236987ba560f26ef6a1c087ab84540 to your computer and use it in GitHub Desktop.
Deploying a Jekyll Website Using Docker
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
# Use an official Ruby runtime as a parent image | |
FROM ruby:3.2.2-bookworm | |
# Install Node.js for some js dependencies | |
RUN apt-get update -qq && apt-get install -y nodejs | |
# Install Jekyll and Bundler | |
RUN gem install bundler jekyll | |
# Set the working directory in the image to /app | |
WORKDIR /app | |
# Add the current directory (inside jekyll site folder) contents into the container at /app | |
ADD . /app | |
# Install any needed packages specified in Gemfile | |
RUN bundle install | |
# Make port 4000 available outside this container | |
EXPOSE 4000 | |
#optionnal: | |
ENV NAME World | |
# Run Jekyll when the container launches | |
CMD ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment