Skip to content

Commit a7bea66

Browse files
committed
deployment/README: Dockerise
1 parent 78b9494 commit a7bea66

2 files changed

Lines changed: 33 additions & 10 deletions

File tree

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM ruby:3.0.1@sha256:d1a8c5160d98cdd51000d3ebfc75ccdad5f43c4b319bbd9e0212dfc337c1e4b5
2+
3+
WORKDIR /srv/jekyll
4+
5+
COPY Gemfile Gemfile.lock ./
6+
7+
RUN gem install bundler:2.2.23
8+
9+
RUN bundle install --jobs 4 --retry 3
10+
11+
RUN chown 1000:1000 -R /srv/jekyll
12+
13+
# Expose Jekyll's default port
14+
EXPOSE 4000
15+
16+
# Default is to serve the site @ localhost:4000
17+
CMD ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0"]

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,27 @@ If you need support about something related to the website, please join `#monero
99

1010
## What you'll need
1111

12-
* Jekyll: [getmonero.org](https://getmonero.org/) is made using a simple, static website generator called [Jekyll](https://jekyllrb.com/). You will need it installed on your system to test any changes that you made. Follow the instructions on the website to get up and going:
13-
* Install Ruby dependencies as suggested [in the Jekyll documentation](https://jekyllrb.com/docs/installation/)
14-
* Install Bundler: `gem install bundler`
15-
* Install Jekyll with all dependencies (run from the project directory): `bundle`
12+
* Docker: to ease development, we are moving to local deployments requiring Docker. Setup instructions for your operating system can be found on the official [Docker website](https://docs.docker.com/desktop/).
1613

1714
* GitHub/GitLab: Pretty much everything in Monero is hosted on [GitHub](https://github.com/monero-project) or [getmonero GitLab](https://repo.getmonero.org/users/monero-project/projects) and uses Git as the primary version control system. If you're not familiar with how to use Git, you can check out [this tutorial](https://guides.github.com/activities/hello-world/) for a good overview. It will take you through pretty much everything you'll need to know to edit the website. If you haven't already, register on GitHub and fork the [Monero Website repository](https://github.com/monero-project/monero-site).
1815

19-
*Note: If you're confused, feel free to click other files in the same directory (folder) that you are in for the step that you are on to see some working examples. Compare them to the instructions and you should understand better.*
16+
1. Navigate to your local `monero-site` git repository.
17+
2. build the Docker container with `docker build --no-cache -t getmonero-container .`
18+
3. Then serve with: `docker run -p 4000:4000 -v $(pwd):/srv/jekyll getmonero-container`. If you want, you can speedup this process by loading only the last blog post instead of all of them. Add `bundle exec jekyll serve --limit_posts 1 --host 0.0.0.0` to the command above.
19+
4. Open a browser and go to [http://127.0.0.1:4000](http://127.0.0.1:4000).
20+
5. If all went well, you should see the Monero website and you're ready to make changes.
2021

21-
Once you have the above list of things, it's encouraged to build the website from your local computer to make sure it works before you make any changes. To do this, complete the following steps:
22+
To build without serving:
2223

23-
1. Navigate to your local `monero-site` repository.
24-
2. Serve the website: `bundle exec jekyll serve`. If you want, you can speedup this process by loading only the last blog post instead of all of them. Simply add `--limit_posts 1` to the command above. The resulting command will be `bundle exec jekyll serve --limit_posts 1`.
25-
3. Open a browser and go to [http://127.0.0.1:4000](http://127.0.0.1:4000).
26-
4. If all went well, you should see the Monero website and you're ready to make changes.
24+
1. Rebuild the Docker container with `docker build --no-cache -t getmonero-container .` (only required if Gemfile* has been modified)
25+
2. `docker run -v $(pwd):/srv/jekyll getmonero-container bundle exec jekyll build` (Output dir can be changed by adding `--destination <output dir>`)
26+
3. If successful, `_site` will contain the generated HTML files.
27+
28+
To update the gems:
29+
30+
1. `docker run -v $(pwd):/srv/jekyll getmonero-container bundle update`
31+
2. Confirm compatibility by rebuilding the container with the new gems using `docker build --no-cache -t getmonero-container .`
32+
3. If updates are found, the resulting `Gemfile.lock` can be pushed to this repo.
2733

2834
## General change recommendations
2935

0 commit comments

Comments
 (0)