]> git.immae.eu Git - github/bastienwirtz/homer.git/blame_incremental - Dockerfile
Dependencies update
[github/bastienwirtz/homer.git] / Dockerfile
... / ...
CommitLineData
1# build stage
2FROM node:lts-alpine as build-stage
3
4WORKDIR /app
5
6COPY package*.json ./
7RUN yarn install --frozen-lockfile
8
9COPY . .
10RUN yarn build
11
12# production stage
13FROM alpine:3.18
14
15ENV GID 1000
16ENV UID 1000
17ENV PORT 8080
18ENV SUBFOLDER "/_"
19ENV INIT_ASSETS 1
20
21RUN addgroup -S lighttpd -g ${GID} && adduser -D -S -u ${UID} lighttpd lighttpd && \
22 apk add -U --no-cache lighttpd
23
24WORKDIR /www
25
26COPY lighttpd.conf /lighttpd.conf
27COPY entrypoint.sh /entrypoint.sh
28COPY --from=build-stage --chown=${UID}:${GID} /app/dist /www/
29COPY --from=build-stage --chown=${UID}:${GID} /app/dist/assets /www/default-assets
30
31USER ${UID}:${GID}
32
33HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
34 CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1
35
36EXPOSE ${PORT}
37
38ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]