From a222dfb558d79835a1a95ca7ee6e4af3882cd807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20J=C3=A4genstedt?= Date: Tue, 19 Dec 2017 12:48:33 +0100 Subject: [PATCH] Switch from Apache to nginx for build.sh --docker Fixes https://github.com/whatwg/html-build/issues/140. Note that none of the redirects from misc-server are included here, and weren't before either, in particular /multipage/images/ won't redirect to /images/. To fix this well the configuration should be shared, which is a bit of work, and so it's left broken for now. --- Dockerfile | 15 ++++++--------- README.md | 2 +- build.sh | 1 + site.conf | 17 ++++------------- 4 files changed, 12 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index 242dfef..7bd539c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,16 @@ FROM debian:sid -## dependency installation: apache, wattsi, and other build tools -## enable some apache mods (the ln -s lines) +## dependency installation: nginx, wattsi, and other build tools ## cleanup freepascal since it is no longer needed after wattsi build RUN apt-get update && \ - apt-get install -y ca-certificates curl git unzip fp-compiler apache2 && \ - cd /etc/apache2/mods-enabled && \ - ln -s ../mods-available/headers.load && \ - ln -s ../mods-available/expires.load && \ + apt-get install -y ca-certificates curl git unzip fp-compiler nginx && \ git clone https://github.com/whatwg/wattsi.git /whatwg/wattsi && \ cd /whatwg/wattsi && \ /whatwg/wattsi/build.sh && \ cp /whatwg/wattsi/bin/wattsi /bin/ && \ apt-get purge -y fp-compiler && \ apt-get autoremove -y && \ + rm -rf /etc/nginx/sites-enabled/* && \ rm -rf /var/lib/apt/lists/* ADD . /whatwg/build @@ -24,7 +21,7 @@ ENV HTML_SOURCE /whatwg/html WORKDIR /whatwg/build -## build and copy assets to final apache dir +## build and copy assets to final nginx dir ARG verbose_or_quiet_flag ARG no_update_flag @@ -34,6 +31,6 @@ RUN SKIP_BUILD_UPDATE_CHECK=true ./build.sh $verbose_or_quiet_flag $no_update_fl rm -rf /var/www/html && \ mv output /var/www/html && \ chmod -R o+rX /var/www/html && \ - cp site.conf /etc/apache2/sites-available/000-default.conf + cp site.conf /etc/nginx/sites-enabled/ -CMD ["apache2ctl", "-DFOREGROUND"] +CMD ["nginx", "-g", "daemon off;"] diff --git a/README.md b/README.md index dc703ca..e97ecd3 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Now you're ready to edit the `html/source` fileā€”and after you make your change ## Building using a Docker container -The Dockerized version of the build allows you to run the build entirely inside a "container" (lightweight virtual machine). This includes tricky dependencies like a local copy of Wattsi, as well as the Apache HTTP server with a setup analogous to that of https://html.spec.whatwg.org. +The Dockerized version of the build allows you to run the build entirely inside a "container" (lightweight virtual machine). This includes tricky dependencies like a local copy of Wattsi, as well an HTTP server setup similar to that of https://html.spec.whatwg.org. To perform a Dockerized build, use the `--docker` flag: diff --git a/build.sh b/build.sh index 0de41d2..efcc064 100755 --- a/build.sh +++ b/build.sh @@ -285,6 +285,7 @@ if [ "$USE_DOCKER" == true ]; then fi docker build "${DOCKER_ARGS[@]}" . + echo "Running server on http://localhost:8080" docker run --rm -it -p 8080:80 whatwg-html exit 0 fi diff --git a/site.conf b/site.conf index 89f2c16..4ffd745 100644 --- a/site.conf +++ b/site.conf @@ -1,13 +1,4 @@ - - DocumentRoot /var/www/html - - - Options Indexes FollowSymLinks - AllowOverride All - Require all granted - - - ErrorLog ${APACHE_LOG_DIR}/error.log - - -# vim: syntax=apache ts=4 sw=4 sts=4 sr noet +server { + root /var/www/html; + error_log stderr; +}