diff options
author | Devan Carpenter <git@dvn.me> | 2019-01-05 19:02:39 -0600 |
---|---|---|
committer | Devan Carpenter <git@dvn.me> | 2019-01-05 19:02:39 -0600 |
commit | 4ee04b58ca8070f468442c8d9841825b151ddf40 (patch) | |
tree | 9d3ad8b77992f4ae9e495c99a9f967fe6adf1798 | |
parent | fedc77e37e154c79c9cfbd83a02ed53902cc9a81 (diff) | |
download | www-4ee04b58ca8070f468442c8d9841825b151ddf40.tar.gz www-4ee04b58ca8070f468442c8d9841825b151ddf40.zip |
Add a Dockerfile and correlated make rules for site generation
These additions can be used for container-driven CI, and for anyone
wanting to quickly generate the site without fussing with setup of
a jinja development environment.
-rw-r--r-- | Dockerfile | 22 | ||||
-rw-r--r-- | Makefile | 13 |
2 files changed, 35 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..04eadc6a --- /dev/null +++ b/Dockerfile | |||
@@ -0,0 +1,22 @@ | |||
1 | # Alternate base image layer: | ||
2 | #FROM debian:buster-slim | ||
3 | |||
4 | FROM ubuntu:18.10 | ||
5 | |||
6 | ENV DEBIAN_FRONTEND noninteractive | ||
7 | |||
8 | RUN apt-get update && \ | ||
9 | apt-get -y install --no-install-recommends \ | ||
10 | gettext \ | ||
11 | make \ | ||
12 | python3 \ | ||
13 | python3-setuptools \ | ||
14 | python3-babel \ | ||
15 | python3-jinja2 && \ | ||
16 | apt-get clean all && \ | ||
17 | apt-get -y autoremove && \ | ||
18 | rm -rf \ | ||
19 | /var/lib/apt/lists/* \ | ||
20 | /tmp/* | ||
21 | |||
22 | CMD /bin/bash -c "cd /tmp/ && make" | ||
@@ -44,3 +44,16 @@ current_dir = $(shell pwd) | |||
44 | run: all | 44 | run: all |
45 | @[ "$(BROWSER)" ] || ( echo "You need to export the environment variable 'BROWSER' to run this."; exit 1 ) | 45 | @[ "$(BROWSER)" ] || ( echo "You need to export the environment variable 'BROWSER' to run this."; exit 1 ) |
46 | $(RUN_BROWSER) $(current_dir)/en/index.html | 46 | $(RUN_BROWSER) $(current_dir)/en/index.html |
47 | |||
48 | |||
49 | # docker-all: Build using a docker image which contains all the needed packages. | ||
50 | |||
51 | docker: docker-all | ||
52 | |||
53 | docker-all: | ||
54 | docker build -t gnunet-www-builder . | ||
55 | # Importing via the shell like this is hacky, | ||
56 | # but after trying lots of other ways, this works most reliably... | ||
57 | python3 -c 'import i18nfix' | ||
58 | docker run --rm -v $$(pwd):/tmp/ --user $$(id -u):$$(id -g) gnunet-www-builder | ||
59 | |||