diff options
author | Bastien Wirtz <bastien.wirtz@gmail.com> | 2022-04-30 15:42:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-30 15:42:31 +0200 |
commit | 7e48e099aa968307d2b99720a076b4bdc706b5fd (patch) | |
tree | 971b362eb335628d818a3faf14ba4a6d9749d850 /Dockerfile | |
parent | af0a6e89c9104ed69766e41f032a4b610ef67ccd (diff) | |
parent | 4f56c2c11baad8f98c338989fb0cd8e5af78d0c8 (diff) | |
download | homer-7e48e099aa968307d2b99720a076b4bdc706b5fd.tar.gz homer-7e48e099aa968307d2b99720a076b4bdc706b5fd.tar.zst homer-7e48e099aa968307d2b99720a076b4bdc706b5fd.zip |
Merge pull request #421 from bastienwirtz/docker-rework
Docker rework
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"] |