-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Docker #1488
Merged
Merged
Add support for Docker #1488
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a6df13b
chore: add a Dockerfile
UlisesGascon 7db2e61
chore: add a Makefile to support Docker operations
UlisesGascon 581babe
docs: update documentation to include Docker support
UlisesGascon 589d822
ci: add step to check Docker build
UlisesGascon 90610c9
fix: typo in docker image reference
UlisesGascon b58dc1f
docs: add information about make help
UlisesGascon 82b54b4
docs: update docker documentation to use advance md features
UlisesGascon 689d5ca
update the make serve log message to have URL
jonchurch b47966a
update to newer jekyll docker image for ruby version
jonchurch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Use the official Jekyll image as the base | ||
FROM jekyll/jekyll:3.7 | ||
|
||
# Set the working directory | ||
WORKDIR /usr/src/app | ||
|
||
# Change the permissions of the working directory | ||
RUN chmod 777 /usr/src/app | ||
|
||
# Copy the Gemfile into the image | ||
COPY Gemfile ./ | ||
|
||
# Install the gems and delete the Gemfile.lock | ||
RUN bundle install --no-cache && rm Gemfile.lock | ||
|
||
# Copy the rest of the project into the image | ||
COPY . . | ||
|
||
# Expose the port Jekyll will run on | ||
EXPOSE 4000 | ||
|
||
# The default command to run Jekyll | ||
CMD ["jekyll", "serve", "--host", "0.0.0.0", "--livereload"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
GREEN := \033[1;32m | ||
BLUE := \033[1;34m | ||
RESET := \033[0m | ||
|
||
# The directory of this file | ||
DIR := $(shell echo $(shell cd "$(shell dirname "${BASH_SOURCE[0]}" )" && pwd )) | ||
|
||
# This will output the help for each task | ||
# thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html | ||
.PHONY: help | ||
|
||
help: ## This help | ||
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "${GREEN}%-30s${RESET} %s\n", $$1, $$2}' $(MAKEFILE_LIST) | ||
|
||
.DEFAULT_GOAL := help | ||
|
||
serve: ## Local server | ||
@echo "${BLUE}Servering website in localhost:4000${RESET}" | ||
docker run -p 4000:4000 -v $(DIR):/usr/src/app expressjs.com | ||
|
||
build: ## Build site | ||
@echo "${BLUE}Building site...${RESET}" | ||
docker build -t expressjs.com . | ||
|
||
clean: ## Clean up | ||
@echo "${BLUE}Clean up...${RESET}" | ||
docker rmi expressjs.com |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, I try to build the docker image and it gives me a segmentation fault:
However, using this docker version solves the problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am getting some issues with this change. Did you change anything else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I only changed the version and this is my docker log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
taking a later docker imag version is necessary for ruby support after I snapped to the gh-pages deps in #1512
It works, maybe nuke your Gemfile.lock before running