diff options
author | Bastien Wirtz <bastien.wirtz@gmail.com> | 2022-03-20 21:46:36 +0100 |
---|---|---|
committer | Bastien Wirtz <bastien.wirtz@gmail.com> | 2022-04-30 10:46:00 +0200 |
commit | cd75da69f9e57c3fe0f63c3ed6def0577d75a47c (patch) | |
tree | 6e290cc8ddc3f34585bb768a2b020f38b7434782 | |
parent | b6b31e440c7915e82fe8b9a4b93083ec9fb2e9fd (diff) | |
download | homer-cd75da69f9e57c3fe0f63c3ed6def0577d75a47c.tar.gz homer-cd75da69f9e57c3fe0f63c3ed6def0577d75a47c.tar.zst homer-cd75da69f9e57c3fe0f63c3ed6def0577d75a47c.zip |
Alias subfolder hosting
-rw-r--r-- | Dockerfile | 5 | ||||
-rw-r--r-- | Dockerfile.arm32v7 | 5 | ||||
-rw-r--r-- | Dockerfile.arm64v8 | 5 | ||||
-rw-r--r-- | lighttpd.conf | 24 |
4 files changed, 16 insertions, 23 deletions
@@ -17,15 +17,16 @@ ENV GROUP lighttpd | |||
17 | ENV GID 911 | 17 | ENV GID 911 |
18 | ENV UID 911 | 18 | ENV UID 911 |
19 | ENV PORT 8080 | 19 | ENV PORT 8080 |
20 | ENV SUBFOLDER "/_" | ||
20 | 21 | ||
21 | RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ | 22 | RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ |
22 | apk add -U --no-cache lighttpd | 23 | apk add -U --no-cache lighttpd |
23 | 24 | ||
24 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ | ||
25 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets | ||
26 | COPY entrypoint.sh /entrypoint.sh | 25 | COPY entrypoint.sh /entrypoint.sh |
27 | COPY lighttpd.conf /lighttpd.conf | 26 | COPY lighttpd.conf /lighttpd.conf |
28 | 27 | ||
28 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ | ||
29 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets | ||
29 | HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ | 30 | HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ |
30 | CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1 | 31 | CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1 |
31 | 32 | ||
diff --git a/Dockerfile.arm32v7 b/Dockerfile.arm32v7 index 2256d2a..01a2196 100644 --- a/Dockerfile.arm32v7 +++ b/Dockerfile.arm32v7 | |||
@@ -26,16 +26,17 @@ ENV GROUP lighttpd | |||
26 | ENV GID 911 | 26 | ENV GID 911 |
27 | ENV UID 911 | 27 | ENV UID 911 |
28 | ENV PORT 8080 | 28 | ENV PORT 8080 |
29 | ENV SUBFOLDER "/_" | ||
29 | 30 | ||
30 | RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ | 31 | RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ |
31 | apk add -U --no-cache lighttpd && \ | 32 | apk add -U --no-cache lighttpd && \ |
32 | rm /usr/bin/qemu-arm-static | 33 | rm /usr/bin/qemu-arm-static |
33 | 34 | ||
34 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ | ||
35 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets | ||
36 | COPY entrypoint.sh /entrypoint.sh | 35 | COPY entrypoint.sh /entrypoint.sh |
37 | COPY lighttpd.conf /lighttpd.conf | 36 | COPY lighttpd.conf /lighttpd.conf |
38 | 37 | ||
38 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ | ||
39 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets | ||
39 | HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ | 40 | HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ |
40 | CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1 | 41 | CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1 |
41 | 42 | ||
diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8 index 7d772f0..f9e6675 100644 --- a/Dockerfile.arm64v8 +++ b/Dockerfile.arm64v8 | |||
@@ -26,16 +26,17 @@ ENV GROUP lighttpd | |||
26 | ENV GID 911 | 26 | ENV GID 911 |
27 | ENV UID 911 | 27 | ENV UID 911 |
28 | ENV PORT 8080 | 28 | ENV PORT 8080 |
29 | ENV SUBFOLDER "/_" | ||
29 | 30 | ||
30 | RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ | 31 | RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ |
31 | apk add -U --no-cache lighttpd && \ | 32 | apk add -U --no-cache lighttpd && \ |
32 | rm /usr/bin/qemu-aarch64-static | 33 | rm /usr/bin/qemu-aarch64-static |
33 | 34 | ||
34 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ | ||
35 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets | ||
36 | COPY entrypoint.sh /entrypoint.sh | 35 | COPY entrypoint.sh /entrypoint.sh |
37 | COPY lighttpd.conf /lighttpd.conf | 36 | COPY lighttpd.conf /lighttpd.conf |
38 | 37 | ||
38 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ | ||
39 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets | ||
39 | HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ | 40 | HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ |
40 | CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1 | 41 | CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1 |
41 | 42 | ||
diff --git a/lighttpd.conf b/lighttpd.conf index da72bf9..04b0bed 100644 --- a/lighttpd.conf +++ b/lighttpd.conf | |||
@@ -1,20 +1,10 @@ | |||
1 | # Minimal config by Kirmy34 | ||
2 | |||
3 | include "/etc/lighttpd/mime-types.conf" | 1 | include "/etc/lighttpd/mime-types.conf" |
4 | 2 | ||
5 | server.port = 8080 | 3 | server.port = env.PORT |
6 | 4 | server.modules = ( "mod_alias" ) | |
7 | server.username = "lighttpd" | 5 | server.username = env.USER |
8 | server.groupname = "lighttpd" | 6 | server.groupname = env.GROUP |
9 | 7 | server.document-root = "/www" | |
10 | server.document-root = "/www" | 8 | alias.url = ( env.SUBFOLDER => "/www" ) |
11 | server.pid-file = "/run/lighttpd.pid" | 9 | server.indexfiles = ("index.html") |
12 | |||
13 | server.indexfiles = ("index.php", "index.html", "index.htm", "default.htm") | ||
14 | |||
15 | server.follow-symlink = "enable" | 10 | server.follow-symlink = "enable" |
16 | |||
17 | static-file.exclude-extensions = (".php", ".pl", ".cgi", ".fcgi") | ||
18 | |||
19 | url.access-deny = ("~", ".inc") | ||
20 | |||