Skip to content

Commit

Permalink
Switch from Apache to nginx for build.sh --docker
Browse files Browse the repository at this point in the history
Fixes #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.
  • Loading branch information
foolip authored and domenic committed Dec 19, 2017
1 parent 614b078 commit a222dfb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 23 deletions.
15 changes: 6 additions & 9 deletions 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
Expand All @@ -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
Expand All @@ -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;"]
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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:

Expand Down
1 change: 1 addition & 0 deletions build.sh
Expand Up @@ -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
Expand Down
17 changes: 4 additions & 13 deletions site.conf
@@ -1,13 +1,4 @@
<VirtualHost *:80>
DocumentRoot /var/www/html

<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
server {
root /var/www/html;
error_log stderr;
}

0 comments on commit a222dfb

Please sign in to comment.