From c9b85650cbca72eb41faddcf7694b9ab766c2b09 Mon Sep 17 00:00:00 2001 From: Jerome Petazzoni Date: Fri, 1 Mar 2019 19:43:53 -0600 Subject: [PATCH] Add Dockerfile and Compose file to build slides Fixes #426 --- slides/Dockerfile | 7 +++++++ slides/README.md | 10 +++++++++- slides/docker-compose.yaml | 16 ++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 slides/Dockerfile create mode 100644 slides/docker-compose.yaml diff --git a/slides/Dockerfile b/slides/Dockerfile new file mode 100644 index 00000000..c9390edb --- /dev/null +++ b/slides/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine +RUN apk update +RUN apk add entr +RUN apk add py-pip +RUN apk add git +COPY requirements.txt . +RUN pip install -r requirements.txt diff --git a/slides/README.md b/slides/README.md index 650d2d7d..25a55c3f 100644 --- a/slides/README.md +++ b/slides/README.md @@ -34,6 +34,14 @@ compile each `foo.yml` file into `foo.yml.html`. You can also run `./build.sh forever`: it will monitor the current directory and rebuild slides automatically when files are modified. +If you have problems running `./build.sh` (because of +Python dependencies or whatever), +you can also run `docker-compose up` in this directory. +It will start the `./build.sh forever` script in a container. +It will also start a web server exposing the slides +(but the slides should also work if you load them from your +local filesystem). + ## Publishing pipeline @@ -53,4 +61,4 @@ You can run `./slidechecker foo.yml.html` to check for missing images and show the number of slides in that deck. It requires `phantomjs` to be installed. It takes some time to run so it is not yet integrated with the publishing -pipeline. \ No newline at end of file +pipeline. diff --git a/slides/docker-compose.yaml b/slides/docker-compose.yaml new file mode 100644 index 00000000..4e620563 --- /dev/null +++ b/slides/docker-compose.yaml @@ -0,0 +1,16 @@ +version: "2" + +services: + www: + image: nginx + volumes: + - .:/usr/share/nginx/html + ports: + - 80 + builder: + build: . + volumes: + - ..:/repo + working_dir: /repo/slides + command: ./build.sh forever +