1
+ FROM arctiqteam/gitbook-base:3.2.3
2
+ # Set paths, permissions, and add content
3
+ ENV APP_ROOT=/opt/app-root
4
+ ENV PATH=${APP_ROOT}/bin:${PATH} HOME=${APP_ROOT}
5
+ # where caddyfile is mounted
6
+ RUN mkdir ${APP_ROOT}/config
7
+ RUN mkdir ${APP_ROOT}/content
8
+ COPY content/ ${APP_ROOT}/content
9
+ COPY Caddyfile ${APP_ROOT}/config
10
+ RUN echo "Installing Caddy V2 (Beta), this is based of a github release and should be checked periodically to ensure the latest version is being used"
11
+ RUN chmod -R u+x ${APP_ROOT}/bin && \
12
+ chgrp -R 0 ${APP_ROOT} && \
13
+ chmod -R g=u ${APP_ROOT} /etc/passwd && \
14
+ mkdir /usr/local/bin/caddy2 && \
15
+ curl -sSL -o caddy_2.4.0-beta.1_linux_amd64.tar.gz -f https://github.com/caddyserver/caddy/releases/download/v2.4.0-beta.1/caddy_2.4.0-beta.1_linux_amd64.tar.gz && \
16
+ tar -xzvf caddy_2.4.0-beta.1_linux_amd64.tar.gz -C /usr/local/bin/ && \
17
+ chmod +x /usr/local/bin/caddy && rm caddy_2.4.0-beta.1_linux_amd64.tar.gz
18
+ # build md into html pages
19
+ RUN cd ${APP_ROOT}/content && \
20
+ chgrp -R 0 ${APP_ROOT}/content && \
21
+ chmod -R g=u ${APP_ROOT}/content && \
22
+ gitbook install && \
23
+ gitbook build && \
24
+ # mv ${APP_ROOT}/_book ${APP_ROOT} && \
25
+ chgrp -R 0 ${APP_ROOT} && \
26
+ chmod -R g+w ${APP_ROOT} && \
27
+ chgrp -R 0 ${APP_ROOT} && \
28
+ chmod -R g=u ${APP_ROOT}
29
+ RUN mv ${APP_ROOT}/content/_book/* ${APP_ROOT}
30
+ WORKDIR ${APP_ROOT}
31
+ EXPOSE 2015
32
+ CMD ["sh" , "-c" , "/usr/local/bin/caddy run --config ${APP_ROOT}/config/Caddyfile" ]
33
+ # TODO FIGUIRE OUT HOW TO BUILD OCP101 and 201 labs independantly!
0 commit comments