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