Skip to content

Commit 34e1b21

Browse files
authored
New dockerfile and docker-compose files (#1540)
1 parent b1164e0 commit 34e1b21

File tree

4 files changed

+55
-65
lines changed

4 files changed

+55
-65
lines changed

Dockerfile

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Use an official Ruby runtime as a parent image
2+
FROM ruby:2.6.4
3+
4+
# Set the working directory in the container
5+
WORKDIR /usr/src/app
6+
7+
# Clone the bitcoinops.github.io repository
8+
RUN git clone https://github.com/bitcoinops/bitcoinops.github.io.git
9+
10+
# Change to the repository directory
11+
WORKDIR /usr/src/app/bitcoinops.github.io
12+
13+
# Install program to configure locales
14+
RUN apt-get update
15+
RUN apt-get install -y locales
16+
RUN dpkg-reconfigure locales && \
17+
locale-gen C.UTF-8 && \
18+
/usr/sbin/update-locale LANG=C.UTF-8
19+
20+
# Install needed default locale for Makefly
21+
RUN echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && \
22+
locale-gen
23+
24+
# Set default locale for the environment
25+
ENV LC_ALL C.UTF-8
26+
ENV LANG en_US.UTF-8
27+
ENV LANGUAGE en_US.UTF-8
28+
29+
# Install any needed gems specified in Gemfile
30+
RUN bundle install
31+
32+
# Make port 4000 available to the world outside this container
33+
EXPOSE 4000

README.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,20 @@ contact us at [[email protected]](mailto:[email protected]).
2020

2121
## Building The Site Locally
2222

23-
To build the site, you need to go through a one-time installation
23+
To build the site without docker, you need to go through a one-time installation
2424
procedure that takes 15 to 30 minutes. After that you can build the
2525
site an unlimited number of times with no extra work.
2626

27-
**[You also can choose to build the site locally by docker, click here to get a guide.](./docker.md)**
27+
**Docker**
28+
29+
Ensure docker and docker-compose are installed. Run the command in the project
30+
directory.
31+
32+
docker-compose up --build
33+
34+
To restart (in the event of code change).
35+
36+
docker-compose down -v && docker-compose up --build
2837

2938
##### Install The Dependencies
3039

docker-compose.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: '3'
2+
3+
services:
4+
bitcoinops:
5+
build: .
6+
ports:
7+
- "4000:4000"
8+
volumes:
9+
- .:/usr/src/app
10+
working_dir: /usr/src/app
11+
command: make preview

docker.md

-63
This file was deleted.

0 commit comments

Comments
 (0)