diff options
author | Kirmy <mikekirmizakis@gmail.com> | 2021-12-09 13:09:09 +0100 |
---|---|---|
committer | Bastien Wirtz <bastien.wirtz@gmail.com> | 2022-04-30 10:46:00 +0200 |
commit | b6b31e440c7915e82fe8b9a4b93083ec9fb2e9fd (patch) | |
tree | 428c97994906574b552f3857f74306a0d8154842 | |
parent | caf5fae8a849f740a603e0377be75df2043fae7f (diff) | |
download | homer-b6b31e440c7915e82fe8b9a4b93083ec9fb2e9fd.tar.gz homer-b6b31e440c7915e82fe8b9a4b93083ec9fb2e9fd.tar.zst homer-b6b31e440c7915e82fe8b9a4b93083ec9fb2e9fd.zip |
Replaced darkhttpd with lighttpd
-rw-r--r-- | Dockerfile | 7 | ||||
-rw-r--r-- | Dockerfile.arm32v7 | 7 | ||||
-rw-r--r-- | Dockerfile.arm64v8 | 7 | ||||
-rw-r--r-- | entrypoint.sh | 4 | ||||
-rw-r--r-- | lighttpd.conf | 20 |
5 files changed, 35 insertions, 10 deletions
@@ -12,18 +12,19 @@ RUN yarn build | |||
12 | # production stage | 12 | # production stage |
13 | FROM alpine:3.15 | 13 | FROM alpine:3.15 |
14 | 14 | ||
15 | ENV USER darkhttpd | 15 | ENV USER lighttpd |
16 | ENV GROUP darkhttpd | 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 | 20 | ||
21 | RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ | 21 | RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ |
22 | apk add -U --no-cache su-exec darkhttpd | 22 | apk add -U --no-cache lighttpd |
23 | 23 | ||
24 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ | 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 | 25 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets |
26 | COPY entrypoint.sh /entrypoint.sh | 26 | COPY entrypoint.sh /entrypoint.sh |
27 | COPY lighttpd.conf /lighttpd.conf | ||
27 | 28 | ||
28 | HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ | 29 | HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ |
29 | CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1 | 30 | CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1 |
diff --git a/Dockerfile.arm32v7 b/Dockerfile.arm32v7 index 95a2db1..2256d2a 100644 --- a/Dockerfile.arm32v7 +++ b/Dockerfile.arm32v7 | |||
@@ -21,19 +21,20 @@ FROM arm32v7/alpine:3.11 | |||
21 | 21 | ||
22 | COPY --from=qemu qemu-arm-static /usr/bin/ | 22 | COPY --from=qemu qemu-arm-static /usr/bin/ |
23 | 23 | ||
24 | ENV USER darkhttpd | 24 | ENV USER lighttpd |
25 | ENV GROUP darkhttpd | 25 | 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 | 29 | ||
30 | RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ | 30 | RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ |
31 | apk add -U --no-cache darkhttpd su-exec && \ | 31 | apk add -U --no-cache lighttpd && \ |
32 | rm /usr/bin/qemu-arm-static | 32 | rm /usr/bin/qemu-arm-static |
33 | 33 | ||
34 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ | 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 | 35 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets |
36 | COPY entrypoint.sh /entrypoint.sh | 36 | COPY entrypoint.sh /entrypoint.sh |
37 | COPY lighttpd.conf /lighttpd.conf | ||
37 | 38 | ||
38 | HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ | 39 | HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ |
39 | CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1 | 40 | CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1 |
diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8 index cd15e4a..7d772f0 100644 --- a/Dockerfile.arm64v8 +++ b/Dockerfile.arm64v8 | |||
@@ -21,19 +21,20 @@ FROM arm64v8/alpine:3.11 | |||
21 | 21 | ||
22 | COPY --from=qemu qemu-aarch64-static /usr/bin/ | 22 | COPY --from=qemu qemu-aarch64-static /usr/bin/ |
23 | 23 | ||
24 | ENV USER darkhttpd | 24 | ENV USER lighttpd |
25 | ENV GROUP darkhttpd | 25 | 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 | 29 | ||
30 | RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ | 30 | RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ |
31 | apk add -U --no-cache darkhttpd su-exec && \ | 31 | apk add -U --no-cache lighttpd && \ |
32 | rm /usr/bin/qemu-aarch64-static | 32 | rm /usr/bin/qemu-aarch64-static |
33 | 33 | ||
34 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ | 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 | 35 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets |
36 | COPY entrypoint.sh /entrypoint.sh | 36 | COPY entrypoint.sh /entrypoint.sh |
37 | COPY lighttpd.conf /lighttpd.conf | ||
37 | 38 | ||
38 | HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ | 39 | HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ |
39 | CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1 | 40 | CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1 |
diff --git a/entrypoint.sh b/entrypoint.sh index 9da2615..e10e17e 100644 --- a/entrypoint.sh +++ b/entrypoint.sh | |||
@@ -18,4 +18,6 @@ if [[ -n "${SUBFOLDER}" ]]; then | |||
18 | fi | 18 | fi |
19 | 19 | ||
20 | chown -R $UID:$GID /www/assets | 20 | chown -R $UID:$GID /www/assets |
21 | exec su-exec $UID:$GID darkhttpd /www/ --no-listing --port "$PORT" | 21 | |
22 | echo "Starting webserver" | ||
23 | lighttpd -D -f /lighttpd.conf | ||
diff --git a/lighttpd.conf b/lighttpd.conf new file mode 100644 index 0000000..da72bf9 --- /dev/null +++ b/lighttpd.conf | |||
@@ -0,0 +1,20 @@ | |||
1 | # Minimal config by Kirmy34 | ||
2 | |||
3 | include "/etc/lighttpd/mime-types.conf" | ||
4 | |||
5 | server.port = 8080 | ||
6 | |||
7 | server.username = "lighttpd" | ||
8 | server.groupname = "lighttpd" | ||
9 | |||
10 | server.document-root = "/www" | ||
11 | server.pid-file = "/run/lighttpd.pid" | ||
12 | |||
13 | server.indexfiles = ("index.php", "index.html", "index.htm", "default.htm") | ||
14 | |||
15 | server.follow-symlink = "enable" | ||
16 | |||
17 | static-file.exclude-extensions = (".php", ".pl", ".cgi", ".fcgi") | ||
18 | |||
19 | url.access-deny = ("~", ".inc") | ||
20 | |||