Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions jekyll/Dockerfile
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 . .

#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"]

1 change: 1 addition & 0 deletions jekyll/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ source "https://rubygems.org"
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 4.2.2"
gem "webrick", "~> 1.7"

# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.5"
Expand Down
23 changes: 23 additions & 0 deletions jekyll/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: '3'
services:
jekyll:
image: my-jekyll-app:latest
# command: jekyll serve --watch --host 0.0.0.0
#volumes:
# - .:/srv/jekyll
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'"