Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ COPY www/ www/
RUN vendor/bin/sculpin generate

FROM php:8.1-apache
RUN ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled
RUN ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-available/headers.load /etc/apache2/mods-enabled
COPY --from=build /app/build/ /var/www/html/
HEALTHCHECK --start-period=1m --start-interval=0.1s --interval=1h \
CMD ["curl", "-I", "--no-progress-meter", "http://localhost/"]
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ directory behind your favorite web server (Apache + PHP-FPM etc.).
Additionally, this should be deployed behind a reverse proxy (nginx) or CDN (Bunny CDN)
that is responsible for HTTPS certificate handling and forcing HTTPS redirects.

Additionally, Apache has been configured to cache static files for 1 day.

The live website is deployed by pushing the contents of the `build/` directory to
the `live` branch like this:

Expand Down
12 changes: 12 additions & 0 deletions tests/integration.bash
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ match() {
curl -v $base/
match "HTTP/.* 200"
match -iE "Content-Type: text/html(;.*)?$"
match -iE "Cache-Control: max-age=86400$"

curl -v $base/index.html
match "HTTP/.* 302"
Expand All @@ -34,6 +35,7 @@ match "HTTP/.* 404"
curl -v $base/blog
match "HTTP/.* 200"
match -iE "Content-Type: text/html(;.*)?$"
match -iE "Cache-Control: max-age=86400$"

curl -v $base/blog.html
match "HTTP/.* 302"
Expand Down Expand Up @@ -99,4 +101,14 @@ curl -v $base/contact/
match "HTTP/.* 302"
match -iE "Location: $redir/contact$"

curl -v $base/posts.atom
match "HTTP/.* 200"
match -iE "Content-Type: application/atom\+xml$"
match -iE "Cache-Control: max-age=86400$"

curl -v $base/src/tailwind.min.css
match "HTTP/.* 200"
match -iE "Content-Type: text/css$"
match -iE "Cache-Control: max-age=86400$"

echo "OK ($n)"
3 changes: 3 additions & 0 deletions www/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ Redirect /psocksd-0.3.4.phar https://github.com/clue/psocksd/releases/download/v
Redirect /psocksd-0.3.3.phar https://github.com/clue/psocksd/releases/download/v0.3.3/psocksd.phar
Redirect /psocksd-0.3.2.phar https://github.com/clue/psocksd/releases/download/v0.3.2/psocksd.phar
Redirect /psocksd-0.3.1.phar https://github.com/clue/psocksd/releases/download/v0.3.1/psocksd.phar

# all files should be cached for 1 day, otherwise any intermediaries may apply their own caching rules
Header set Cache-Control "max-age=86400"
Loading