-
-
Notifications
You must be signed in to change notification settings - Fork 6
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 docker to the local development #29 #30
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Use the official Ruby image as a base | ||
FROM ruby:3.1.6 | ||
|
||
# Install dependencies for Jekyll | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
libffi-dev \ | ||
libgdbm-dev \ | ||
libsqlite3-dev \ | ||
libssl-dev \ | ||
libreadline-dev \ | ||
zlib1g-dev | ||
|
||
# Install Bundler and Jekyll separately | ||
RUN gem install bundler:2.5.20 | ||
RUN gem install jekyll | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /usr/src/app | ||
|
||
# Copy the Gemfile and Gemfile.lock (if exists) | ||
COPY Gemfile* ./ | ||
|
||
# Install the Jekyll gems using bundler | ||
RUN bundle install | ||
|
||
# Copy the rest of your site files | ||
COPY . . | ||
Comment on lines
+27
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. better to use mounts instead of copying files |
||
|
||
#RUN ./scripts/overwrite-data.sh && ./scripts/build.sh | ||
|
||
# Expose the port Jekyll will run on | ||
EXPOSE 4000 | ||
|
||
# Command to run Jekyll | ||
#CMD ["jekyll", "serve", "--host", "0.0.0.0", "--watch"] | ||
CMD ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0", "--watch"] | ||
#CMD ["bundle", "exec", "jekyll", "serve", "--source", "jekyll", "--host", "0.0.0.0", "--port", "4000", "--watch"] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
version: '3' | ||
services: | ||
jekyll: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The build section is missing |
||
image: my-jekyll-app:latest | ||
# command: jekyll serve --watch --host 0.0.0.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this line can be deleted |
||
#volumes: | ||
# - .:/srv/jekyll | ||
Comment on lines
+6
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. better to use mounts instead of copying files |
||
ports: | ||
- "4000:4000" | ||
environment: | ||
- RAILS_ENV=development | ||
node: | ||
image: node:latest # Use an appropriate Node.js image | ||
volumes: | ||
- ../:/usr/src/app # Mount your project directory | ||
working_dir: /usr/src/app | ||
# command: prettier --write docs/index.html # Adjust the file types as needed | ||
|
||
# Add an initialization step to install Prettier before running | ||
# entrypoint: /bin/sh -c "npm install --global prettier && prettier --write docs/index.html" | ||
|
||
#multiple files | ||
entrypoint: /bin/sh -c "npm install --global prettier && prettier --write 'docs/**/*.html'" | ||
Comment on lines
+12
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove node service |
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.
It would be better if this file was based on https://github.com/creativecommons/cc-resource-archive/blob/e00da263989a8f042151a459380469bf9b8cd8ee/dev/jekyll/Dockerfile