diff --git a/jekyll/Dockerfile b/jekyll/Dockerfile new file mode 100644 index 0000000..1d7d67b --- /dev/null +++ b/jekyll/Dockerfile @@ -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"] + diff --git a/jekyll/Gemfile b/jekyll/Gemfile index 5a8d37f..e0dd800 100644 --- a/jekyll/Gemfile +++ b/jekyll/Gemfile @@ -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" diff --git a/jekyll/docker-compose.yml b/jekyll/docker-compose.yml new file mode 100644 index 0000000..22f025a --- /dev/null +++ b/jekyll/docker-compose.yml @@ -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'" \ No newline at end of file