Skip to content

Comments

Add Dockerfile for gh-pages site#8494

Closed
garethrees wants to merge 2 commits intogh-pagesfrom
gh-pages-docker
Closed

Add Dockerfile for gh-pages site#8494
garethrees wants to merge 2 commits intogh-pagesfrom
gh-pages-docker

Conversation

@garethrees
Copy link
Member

@garethrees garethrees commented Dec 18, 2024

Add Dockerfile

Avoid having to faff with local dependencies.

docker compose build
docker compose up
open http://0.0.0.0:4000

[skip changelog]

Avoid having to faff with local dependencies.

    docker-compose build
    docker-compose up
    open http://0.0.0.0:4000
@garethrees garethrees changed the title Gh pages docker Add Dockerfile for gh-pages site Dec 18, 2024
@garethrees garethrees requested a review from gbp January 23, 2025 12:52
FROM ruby:3.2

WORKDIR /app
COPY . .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think we need a .dockerignore file as when building the image the whole current directory is copied into the image, which in my case is gigabytes in size!

Something like:

.*
cache/
commonlib/
config/
coverage/
db/
files/
gems/
lib/
public/
storage/
tmp/

WORKDIR /app
COPY . .

RUN gem install bundler jekyll
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No point in this as its already in the Gemfile.lock and could install a different versions than we're really using.

Suggested change
RUN gem install bundler jekyll

@@ -0,0 +1,11 @@
FROM ruby:3.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets keep the image and small as possible

Suggested change
FROM ruby:3.2
FROM ruby:3.2-slim
RUN apt-get update -qq && \
apt-get install -y \
build-essential \
git \
&& rm -rf /var/lib/apt/lists/*


EXPOSE 4000

CMD ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be good, if it works?

Suggested change
CMD ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0"]
CMD ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0", "--livereload"]

Comment on lines +1 to +2
version: '3.8'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker warns against including a version now. We should remove.

Suggested change
version: '3.8'

@garethrees
Copy link
Member Author

Closing for now; will reopen next time someone needs this

@garethrees garethrees closed this Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants