working local build of gh pages

This commit is contained in:
Paul Gauthier 2024-06-05 09:23:28 -07:00
parent 72493f0920
commit 46b953ebeb
3 changed files with 17 additions and 11 deletions

View file

@ -3,3 +3,5 @@ gem 'jekyll'
gem 'jekyll-theme-cayman' gem 'jekyll-theme-cayman'
gem 'jekyll-redirect-from' gem 'jekyll-redirect-from'
gem 'jekyll-sitemap' gem 'jekyll-sitemap'
gem "webrick"
gem 'github-pages', group: :jekyll_plugins

View file

@ -1,20 +1,16 @@
# Use the official Jekyll image from Docker Hub # Use the official Jekyll image from Docker Hub
FROM jekyll/jekyll:latest FROM bretfisher/jekyll-serve
# Set the working directory # Set the working directory
WORKDIR /srv/jekyll WORKDIR /site
# Copy the current directory contents into the container at /srv/jekyll # Copy the current directory contents into the container at /srv/jekyll
COPY . /srv/jekyll COPY . /site
# Install any needed packages specified in Gemfile # Install any needed packages specified in Gemfile
RUN bundle install RUN bundle install --retry 5 --jobs 20
# Expose port 4000 to the host ENTRYPOINT [ "docker-entrypoint.sh" ]
EXPOSE 4000
# Health check to ensure the server is running CMD [ "bundle", "exec", "jekyll", "serve", "--force_polling", "-H", "0.0.0.0", "-P", "4000" ]
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s CMD curl -f http://localhost:4000 || exit 1
# Run Jekyll server
CMD ["jekyll", "serve", "--host", "0.0.0.0", "--port", "4000", "--verbose"]

View file

@ -1,4 +1,12 @@
#!/bin/bash #!/bin/bash
# Run the Docker container # Run the Docker container
docker run --rm --network="host" -v "$PWD:/srv/jekyll" -p 4000:4000 --entrypoint /bin/bash -it my-jekyll-site docker run \
--rm \
-v "$PWD:/site" \
-p 4000:4000 \
my-jekyll-site
# -e HISTFILE=/srv/jekyll/.bash_history \
# --entrypoint /bin/bash \
# -it \