diff options
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -12,22 +12,28 @@ 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 GID 1000 |
16 | ENV GROUP darkhttpd | 16 | ENV UID 1000 |
17 | ENV GID 911 | ||
18 | ENV UID 911 | ||
19 | ENV PORT 8080 | 17 | ENV PORT 8080 |
18 | ENV SUBFOLDER "/_" | ||
19 | ENV INIT_ASSETS 1 | ||
20 | 20 | ||
21 | RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ | 21 | RUN addgroup -S lighttpd -g ${GID} && adduser -D -S -u ${UID} lighttpd lighttpd && \ |
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 | WORKDIR /www |
25 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets | 25 | |
26 | COPY lighttpd.conf /lighttpd.conf | ||
26 | COPY entrypoint.sh /entrypoint.sh | 27 | COPY entrypoint.sh /entrypoint.sh |
28 | COPY --from=build-stage --chown=${UID}:${GID} /app/dist /www/ | ||
29 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets | ||
30 | |||
31 | USER ${UID}:${GID} | ||
27 | 32 | ||
28 | HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ | 33 | HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ |
29 | CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1 | 34 | CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1 |
30 | 35 | ||
31 | EXPOSE ${PORT} | 36 | EXPOSE ${PORT} |
32 | VOLUME /www/assets | 37 | VOLUME /www/assets |
38 | |||
33 | ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] | 39 | ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] |