]> git.immae.eu Git - github/bastienwirtz/homer.git/blob - Dockerfile
Alias subfolder hosting
[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.15
14
15 ENV USER lighttpd
16 ENV GROUP lighttpd
17 ENV GID 911
18 ENV UID 911
19 ENV PORT 8080
20 ENV SUBFOLDER "/_"
21
22 RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \
23 apk add -U --no-cache lighttpd
24
25 COPY entrypoint.sh /entrypoint.sh
26 COPY lighttpd.conf /lighttpd.conf
27
28 COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/
29 COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets
30 HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
31 CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1
32
33 EXPOSE ${PORT}
34 VOLUME /www/assets
35 ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]