Skip to content

Commit 22c986b

Browse files
committed
use docker and compose to serve
1 parent 2be20e8 commit 22c986b

File tree

5 files changed

+271
-103
lines changed

5 files changed

+271
-103
lines changed

.dockerignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Build output
2+
_site/
3+
bin/
4+
*.html
5+
*.pdf
6+
*.epub
7+
8+
# Dependencies
9+
node_modules/
10+
.gem/
11+
vendor/
12+
13+
# Git
14+
.git/
15+
.gitignore
16+
17+
# Editor/IDE
18+
.vscode/
19+
.idea/
20+
*.swp
21+
*.swo
22+
*~
23+
24+
# OS
25+
.DS_Store
26+
Thumbs.db
27+
28+
# Temporary files
29+
*.tmp
30+
*.temp
31+
/tmp
32+
33+
# Logs
34+
*.log
35+
npm-debug.log*
36+
37+
# Docker
38+
Dockerfile*
39+
docker-compose*
40+
.dockerignore
41+
42+
# Development
43+
TODO
44+
ATMP-validation-flow.png
45+
OP_RETURN.ipynb
46+
exercise_tutorial-extended_class.ipynb
47+
favicon.ico

Dockerfile

Lines changed: 17 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,23 @@
1-
FROM ruby:3.2.2-slim-bookworm
1+
FROM docker.io/library/ruby:3.2.2-slim
22

3-
RUN apt update && \
4-
apt --yes upgrade && \
5-
apt --yes install build-essential curl procps git \
6-
fonts-liberation libasound2 \
7-
libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 \
8-
libfontconfig1 libgbm1 libgcc1 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 \
9-
libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 \
10-
libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \
11-
--no-install-recommends && \
12-
rm -rf /var/lib/apt/lists/*
3+
# Install system dependencies
4+
RUN apt-get update && apt-get install --yes --no-install-recommends \
5+
build-essential \
6+
git \
7+
nodejs \
8+
npm \
9+
chromium \
10+
make \
11+
&& rm -rf /var/lib/apt/lists/*
1312

14-
ARG UID=1000
15-
ARG GID=1000
13+
# Set chromium path for puppeteer (needed for mermaid diagrams)
14+
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
1615

17-
WORKDIR /srv/
18-
COPY Gemfile /srv/Gemfile
16+
# Install correct bundler version
17+
RUN gem install bundler -v 2.7.1
1918

20-
RUN groupadd -g ${GID} docs && \
21-
useradd -m -u ${UID} -g docs -s /bin/bash docs
22-
RUN chown -R docs:docs /srv/
23-
USER docs
19+
WORKDIR /srv
2420

25-
RUN bash -l -c "echo 'export GEM_HOME=${HOME}/.gem' >> ${HOME}/.bashrc \
26-
&& echo 'export GEM_PATH=${HOME}/.gem' >> ${HOME}/.bashrc \
27-
&& source ~/.bashrc \
28-
&& bundle config set --local path ${HOME}/.gem \
29-
&& bundle install"
21+
EXPOSE 4000
3022

31-
RUN bash -l -c "curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash \
32-
&& export NVM_DIR=\"\$([ -z \"${XDG_CONFIG_HOME-}\" ] && printf %s \"${HOME}/.nvm\" || printf %s \"${XDG_CONFIG_HOME}/nvm\")\" \
33-
&& [ -s \"\$NVM_DIR/nvm.sh\" ] && \\. \"\$NVM_DIR/nvm.sh\" \
34-
&& echo 'export PATH=${PATH}:/srv/node_modules/.bin' >> ${HOME}/.bashrc \
35-
&& source ~/.bashrc \
36-
&& nvm install node \
37-
&& npm install @mermaid-js/mermaid-cli"
38-
39-
ENV LANG C.UTF-8
40-
ENV LC_ALL C.UTF-8
41-
ENTRYPOINT ["bash", "-l"]
23+
CMD ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0", "--future", "--drafts", "--unpublished", "--incremental"]

0 commit comments

Comments
 (0)