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