Compare commits

..

10 Commits

8 changed files with 87 additions and 48 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
Dockerfile
Makefile
_site

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "_vendor/jekyll-theme-console"]
path = _vendor/jekyll-theme-console
url = https://github.com/b2a3e8/jekyll-theme-console

View File

@ -1,12 +1,14 @@
FROM jekyll/minimal:3.8
RUN apk update && apk add g++ make
FROM ruby:3.2.2-alpine AS builder
LABEL stage=distrust-co-builder
RUN apk update && apk add g++ make git git-lfs
RUN mkdir -p /home
COPY Gemfile /home
COPY Gemfile.lock /home
RUN chmod -R 777 /home
COPY _vendor /home/_vendor
WORKDIR /home
RUN bundle install
COPY . /home
RUN jekyll build
CMD ["jekyll", "serve"]
FROM nginx
COPY --from=builder /home/_site /usr/share/nginx/html

View File

@ -1,5 +1,2 @@
source "https://rubygems.org"
gem "jekyll", "~> 3.8"
gem "jekyll-theme-console"
gem "sassc", "~> 2.1.0"
gem "kramdown-parser-gfm"
gem "jekyll-theme-console", path: "./_vendor/jekyll-theme-console"

View File

@ -1,39 +1,47 @@
PATH
remote: _vendor/jekyll-theme-console
specs:
jekyll-theme-console (0.4.0)
jekyll (>= 3.5)
jekyll-seo-tag
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.1)
addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0)
colorator (1.1.0)
concurrent-ruby (1.2.0)
concurrent-ruby (1.2.2)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.15.5)
forwardable-extended (2.6.0)
google-protobuf (3.23.4-x86_64-linux)
http_parser.rb (0.8.0)
i18n (0.9.5)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
jekyll (3.9.2)
jekyll (4.3.2)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 0.7)
jekyll-sass-converter (~> 1.0)
i18n (~> 1.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0)
kramdown (>= 1.17, < 3)
kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.3.3)
mercenary (>= 0.3.6, < 0.5)
pathutil (~> 0.9)
rouge (>= 1.7, < 4)
rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-sass-converter (3.0.0)
sass-embedded (~> 1.54)
jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
jekyll-theme-console (0.4.0)
jekyll (>= 3.5)
jekyll-seo-tag
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.4.0)
@ -44,32 +52,28 @@ GEM
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
mercenary (0.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (5.0.1)
public_suffix (5.0.3)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (3.30.0)
rouge (4.1.2)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sassc (2.1.0)
ffi (~> 1.9)
sass-embedded (1.64.1-x86_64-linux-musl)
google-protobuf (~> 3.23)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.4.2)
webrick (1.8.1)
PLATFORMS
ruby
x86_64-linux-musl
DEPENDENCIES
jekyll (~> 3.8)
jekyll-theme-console
kramdown-parser-gfm
sassc (~> 2.1.0)
jekyll-theme-console!
BUNDLED WITH
2.1.4
2.4.10

View File

@ -3,15 +3,20 @@ build:
# Build Docker image
docker build -t distrust-co .
# Export site to _site directory
docker run -v $(shell pwd):/home -it distrust-co jekyll build
.PHONY: fullclean
fullclean: clean
docker rmi distrust-co -f
docker image prune --filter label=stage=distrust-co-builder
.PHONY: clean
clean:
rm -r _site
_site: build
mkdir -p _site
docker run distrust-co tar c -C /usr/share/nginx/html . | tar x -C _site
.PHONY: serve
serve:
# Run Docker container with listener for current dir and port mapping
docker run -v $(shell pwd):/home -p 0.0.0.0:4000:4000 -it distrust-co
.PHONY: clean
clean:
# Remove _site directory
rm -rf _site
docker run --rm -p 0.0.0.0:4000:80 -it distrust-co

View File

@ -4,13 +4,37 @@ Web page source.
## Instructions
0. If the repo was not cloned with submodules:
```shell
$ git submodule update --init --recursive
```
1. Install `make`.
2. Install `docker`
3. Build (export) site to `_site` directory:
```shell
$ make build
```
4. Serve site at `0.0.0.0:4000`:
```shell
$ make serve
```
### Generate Static Files
1. Output static files in `_site` directory:
```shell
$ make _site
```
### Cleanup
1. Remove all build artifacts:
```shell
$ make fullclean
```

@ -0,0 +1 @@
Subproject commit 76983908faa6f06ffd87b70165f2632790d36687