aboutsummaryrefslogtreecommitdiffhomepage
path: root/Dockerfile
diff options
context:
space:
mode:
authorBastien Wirtz <bastien.wirtz@gmail.com>2022-04-30 15:42:31 +0200
committerGitHub <noreply@github.com>2022-04-30 15:42:31 +0200
commit7e48e099aa968307d2b99720a076b4bdc706b5fd (patch)
tree971b362eb335628d818a3faf14ba4a6d9749d850 /Dockerfile
parentaf0a6e89c9104ed69766e41f032a4b610ef67ccd (diff)
parent4f56c2c11baad8f98c338989fb0cd8e5af78d0c8 (diff)
downloadhomer-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--Dockerfile22
1 files changed, 14 insertions, 8 deletions
diff --git a/Dockerfile b/Dockerfile
index 0a43027..0e9d51a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -12,22 +12,28 @@ RUN yarn build
12# production stage 12# production stage
13FROM alpine:3.15 13FROM alpine:3.15
14 14
15ENV USER darkhttpd 15ENV GID 1000
16ENV GROUP darkhttpd 16ENV UID 1000
17ENV GID 911
18ENV UID 911
19ENV PORT 8080 17ENV PORT 8080
18ENV SUBFOLDER "/_"
19ENV INIT_ASSETS 1
20 20
21RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ 21RUN 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
24COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ 24WORKDIR /www
25COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets 25
26COPY lighttpd.conf /lighttpd.conf
26COPY entrypoint.sh /entrypoint.sh 27COPY entrypoint.sh /entrypoint.sh
28COPY --from=build-stage --chown=${UID}:${GID} /app/dist /www/
29COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets
30
31USER ${UID}:${GID}
27 32
28HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ 33HEALTHCHECK --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
31EXPOSE ${PORT} 36EXPOSE ${PORT}
32VOLUME /www/assets 37VOLUME /www/assets
38
33ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] 39ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]