Skip to content

Commit 7d6eb50

Browse files
committed
Move to running in a container
The Caddy in Fedora is old and buggy, unfortunately.
1 parent 2915827 commit 7d6eb50

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/sites/

Caddyfile

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
redir /{args.0} /{args.0}/ permanent
77

88
handle_path /{args.0}/* {
9-
root * {args.0}
9+
root * {$SITE_DIR:sites}/{args.0}
1010
file_server
1111
}
1212
}
@@ -26,15 +26,14 @@
2626
# Place the brochure site at the top level.
2727
import subproject mpl-brochure-site
2828
@brochure file {
29-
root mpl-brochure-site
30-
try_files {path}
29+
root {$SITE_DIR:sites}/mpl-brochure-site
3130
}
3231
rewrite / /mpl-brochure-site/index.html
3332
rewrite @brochure /mpl-brochure-site{http.matchers.file.relative}
3433

3534
# Finally try any of the versioned docs.
3635
handle {
37-
root * matplotlib.github.com
36+
root * {$SITE_DIR:sites}/matplotlib.github.com
3837
file_server
3938
}
4039
}

Makefile

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
RUNTIME ?= podman
2+
CADDY_VERSION ?= 2.4.6
3+
4+
serve:
5+
mkdir -p sites
6+
$(RUNTIME) run --rm -it \
7+
-v $$PWD/sites:/srv:Z \
8+
-v $$PWD/Caddyfile:/etc/caddy/Caddyfile:ro,Z \
9+
-e SITE_DIR=/srv \
10+
-p 2015:2015 \
11+
docker.io/library/caddy:$(CADDY_VERSION) \
12+
caddy run --config /etc/caddy/Caddyfile --watch
13+
14+
fmt:
15+
$(RUNTIME) run --rm -it \
16+
-v $$PWD/Caddyfile:/etc/caddy/Caddyfile:Z \
17+
docker.io/library/caddy:$(CADDY_VERSION) \
18+
caddy fmt --overwrite /etc/caddy/Caddyfile

0 commit comments

Comments
 (0)