Skip to content

Commit 7263295

Browse files
committed
Modified Dockerfile for building/hosting docs
Made a number of modifications to the Dockerfile in the repo: * Minimized the number of cache layers in final image (by reducing the number of Run commands) * This way Docker will not reuse cache layers containing outdated package versions. * Purge build dependencies and apt cache data. * These files do not appear in final image due to minimal intermediate cache layers. * The resulting image is over 100 MB smaller as a result. * Update NodeJS to the latest stable release via the [n](https://github.com/tj/n) script. * Added Test::META module and GNU aspell (used in tests). Also added a .dockerignore file, so that files within the repo do not get used in the build context.
1 parent b5a674d commit 7263295

File tree

2 files changed

+39
-23
lines changed

2 files changed

+39
-23
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
./*
2+
.sass-cache/
3+
.git/
4+
.gitignore
5+
.travis.yml

Dockerfile

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,36 @@
11
FROM rakudo-star:latest
22

3-
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
4-
5-
RUN apt-get --yes --no-install-recommends install \
6-
ruby-sass \
7-
cpanminus \
8-
build-essential \
9-
nodejs \
10-
graphviz \
11-
;
12-
13-
RUN zef install Pod::To::HTML Pod::To::BigPage
14-
15-
RUN cpanm -vn Mojolicious
16-
17-
RUN cpanm -vn CSS::Sass Mojolicious::Plugin::AssetPack
18-
19-
RUN mkdir /doc
20-
21-
WORKDIR /doc
22-
23-
EXPOSE 3000
24-
25-
CMD bash -c "make init-highlights && perl6 htmlify.p6 && perl app.pl daemon"
3+
RUN buildDeps=' \
4+
build-essential \
5+
cpanminus \
6+
npm \
7+
' \
8+
runtimeDeps=' \
9+
graphviz \
10+
make \
11+
nodejs \
12+
ruby-sass \
13+
' \
14+
testDeps=' \
15+
aspell \
16+
' \
17+
18+
&& set -x \
19+
&& apt-get update \
20+
&& apt-get --yes --no-install-recommends install $buildDeps $runtimeDeps $testDeps \
21+
&& rm -rf /var/lib/apt/lists/* \
22+
23+
&& cpanm -vn Mojolicious \
24+
&& zef install Test::META \
25+
26+
&& ln -s /usr/bin/nodejs /usr/bin/node \
27+
&& npm cache clean -f \
28+
&& npm install -g n \
29+
&& n stable \
30+
31+
&& apt-get purge --yes --auto-remove $buildDeps
32+
33+
WORKDIR /perl6/doc/
34+
EXPOSE 3000
35+
36+
CMD bash -c 'make test && make html && ./app-start'

0 commit comments

Comments
 (0)