X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=Dockerfile;h=112db17cb567deceaf5d1e6ce86035980e3b8764;hb=c11c45a661addf377ac5f4773ba39f5ef66ec155;hp=fd1120f6a1229eaaab8d58a70b1933066f757ee5;hpb=ac1442c640645b1b80b98fc3c25504df439ea1fa;p=github%2Fbastienwirtz%2Fhomer.git diff --git a/Dockerfile b/Dockerfile index fd1120f..112db17 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,24 +4,36 @@ FROM node:lts-alpine as build-stage WORKDIR /app COPY package*.json ./ -RUN yarn install +RUN yarn install --frozen-lockfile COPY . . RUN yarn build # production stage -FROM alpine:3.11 +FROM alpine:3.16 -COPY --from=build-stage /app/dist /www/ +ENV GID 1000 +ENV UID 1000 +ENV PORT 8080 +ENV SUBFOLDER "/_" +ENV INIT_ASSETS 1 -ENV USER darkhttpd -ENV GROUP darkhttpd -ENV GID 911 -ENV UID 911 +RUN addgroup -S lighttpd -g ${GID} && adduser -D -S -u ${UID} lighttpd lighttpd && \ + apk add -U --no-cache lighttpd -RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ - apk add -U darkhttpd +WORKDIR /www -USER ${USER} +COPY lighttpd.conf /lighttpd.conf +COPY entrypoint.sh /entrypoint.sh +COPY --from=build-stage --chown=${UID}:${GID} /app/dist /www/ +COPY --from=build-stage --chown=${UID}:${GID} /app/dist/assets /www/default-assets -ENTRYPOINT ["darkhttpd","/www/", "--no-listing"] \ No newline at end of file +USER ${UID}:${GID} + +HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ + CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1 + +EXPOSE ${PORT} +VOLUME /www/assets + +ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]