Skip to content

docker: speed up building, improve documentation #2222

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

Merged
merged 3 commits into from
Mar 31, 2025
Merged
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
19 changes: 8 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
# Use an official Ruby runtime as a parent image
FROM ruby:2.6.4

# Set the working directory in the container
WORKDIR /usr/src/app

# Clone the bitcoinops.github.io repository
RUN git clone https://github.com/bitcoinops/bitcoinops.github.io.git

# Change to the repository directory
WORKDIR /usr/src/app/bitcoinops.github.io

# Install program to configure locales
RUN apt-get update
RUN apt-get install -y locales
RUN apt-get update && \
apt-get install -y locales
RUN dpkg-reconfigure locales && \
locale-gen C.UTF-8 && \
/usr/sbin/update-locale LANG=C.UTF-8
Expand All @@ -26,6 +17,12 @@ ENV LC_ALL C.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

# Set the working directory
WORKDIR /usr/src/app

# Copy just the Gemfile and Gemfile.lock first to leverage Docker cache
COPY Gemfile Gemfile.lock ./

# Install any needed gems specified in Gemfile
RUN bundle install

Expand Down
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,25 @@ site an unlimited number of times with no extra work.

**Docker**

Ensure docker and docker-compose are installed. Run the command in the project
directory.
Using Docker eliminates the need for local Ruby installation and
simplifies the setup process. Ensure Docker and Docker Compose are
installed, then run the following command in the project directory:

docker-compose up --build
docker compose up

To restart (in the event of code change).
This will build the Docker image if needed and start the Jekyll server.
The site preview will be available at http://localhost:4000.

docker-compose down -v && docker-compose up --build
For most code changes, Jekyll's live reload will automatically update
the preview. You only need to restart the container when making changes
such as:

- Changing dependencies in the Gemfile
- Modifying Docker configuration files

To rebuild and restart the container:

docker compose down && docker compose up --build

##### Install The Dependencies

Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ services:
- "4000:4000"
volumes:
- .:/usr/src/app
working_dir: /usr/src/app
command: make preview