From b196389308f684868e474a3d86ca0afab1281e9b Mon Sep 17 00:00:00 2001 From: Philippe Coval Date: Thu, 5 Mar 2020 11:07:58 +0100 Subject: [PATCH] docker: Build and serve content on http Usage: docker-compose up --build x-www-browser http://localhost/Readme.html Origin: https://github.com/rzr/rzr-presentations Change-Id: Idb35900e551503f4777e0f6a8af8fb50c70e483b Signed-off-by: Philippe Coval --- .dockerignore | 6 ++++++ Dockerfile | 54 ++++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 12 +++++++++++ 3 files changed, 72 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fa6bc59 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +# .dockerignore +.git/ +# .gitignore +*~ +*.html +*.elc diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bb7d042 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,54 @@ +#!/bin/echo docker build . -f +# -*- coding: utf-8 -*- +# +# SPDX-License: ISC +# SPDX-License-URL: https://spdx.org/licenses/ISC.txt + +FROM httpd:2.4 +LABEL maintainer="Philippe Coval (https://purl.org/rzr)" + +ENV DEBIAN_FRONTEND noninteractive +ENV LC_ALL en_US.UTF-8 +ENV LANG ${LC_ALL} + +RUN echo "#log: Configuring locales" \ + && set -x \ + && apt-get update \ + && apt-get install -y locales \ + && echo "${LC_ALL} UTF-8" | tee /etc/locale.gen \ + && locale-gen ${LC_ALL} \ + && dpkg-reconfigure locales \ + && sync + +RUN echo "#log: Preparing system" \ + && set -x \ + && apt-get update -y \ + && apt-get install -y \ + make \ + sudo \ + emacs \ + wget \ + git \ + unzip \ + # EOL + && sync + +ENV project org-reveal +ENV workdir /usr/local/apache2/htdocs/ +ADD Makefile ${workdir}/ +WORKDIR ${workdir} + +RUN echo "#log: Setup ${project}" \ + && set -x \ + && make help \ + && make setup/debian sudo="" \ + && make setup \ + && sync + +ADD . ${workdir}/ +WORKDIR ${workdir} + +RUN echo "#log: Building ${project}" \ + && set -x \ + && make download all \ + && sync diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d712590 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +#!/bin/echo docker-compose up --build +# -*- coding: utf-8 -*- +# +# SPDX-License: ISC +# SPDX-License-URL: https://spdx.org/licenses/ISC.txt + +version: "2" + +services: + default: + build: . + network_mode: "host"