Skip to content

Commit

Permalink
Merge pull request #2 from Gepardec/feature/optimizations
Browse files Browse the repository at this point in the history
Feature/optimizations
  • Loading branch information
fhochleitner authored Feb 11, 2022
2 parents d5aa6d2 + 34a73e6 commit 76a6276
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
docs/
.gitignore
.gitattributes
.dockerignore
.github/
.nojekyll
LICENSE
*.sh
*.md
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM node:16

ARG VERSION_REVEALJS='4.1.2'

RUN apt update && \
apt install -y --no-install-recommends \
tree \
Expand All @@ -21,7 +23,7 @@ RUN apt update && \
WORKDIR /opt/revealjs

RUN ln -s /usr/bin/nodejs /usr/bin/node && \
git clone --shallow-submodules --recurse-submodules --branch 4.1.2 https://github.com/hakimel/reveal.js.git /opt/revealjs && \
git clone --shallow-submodules --recurse-submodules --branch ${VERSION_REVEALJS} https://github.com/hakimel/reveal.js.git /opt/revealjs && \
git clone https://github.com/denehyg/reveal.js-menu.git /opt/revealjs/plugin/menu && \
npm cache clean --force && \
npm install -f
Expand Down
11 changes: 7 additions & 4 deletions make.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ readonly SCRIPT_HOME=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
set -ex

rm -rf docs
mkdir docs
docker build -t presentations .
docker container rm -f presentation >/dev/null
docker run -d --entrypoint=/opt/revealjs/bin/present.py --name presentation presentations Training-for-Containerization 8080
docker cp presentation:/opt/revealjs/ docs
# Selective copy to improve performace, takes forever if everything is copied
docker cp presentation:/opt/revealjs/dist docs/dist
docker cp presentation:/opt/revealjs/images docs/images
docker cp presentation:/opt/revealjs/plugin docs/plugin
docker cp presentation:/opt/revealjs/src docs/src

chmod -R 777 docs

for presentation in src/presentations/*; do
Expand All @@ -35,6 +41,3 @@ done
docker container rm -f presentation >/dev/null
docker run -d --entrypoint=/opt/revealjs/bin/present.py --name presentation presentations index 8080
docker cp presentation:/opt/revealjs/index.html docs/index.html
docker rm -f presentation > /dev/null

rm -rf docs/{.git,.github,node_modules}

0 comments on commit 76a6276

Please sign in to comment.