]> git.immae.eu Git - github/bastienwirtz/homer.git/blame - Dockerfile
Alias subfolder hosting
[github/bastienwirtz/homer.git] / Dockerfile
CommitLineData
b9c5fcf0
BW
1# build stage
2FROM node:lts-alpine as build-stage
3
4WORKDIR /app
5
6COPY package*.json ./
e6596ca6 7RUN yarn install --frozen-lockfile
b9c5fcf0
BW
8
9COPY . .
10RUN yarn build
11
12# production stage
e961af82 13FROM alpine:3.15
7d5c71d7 14
b6b31e44
K
15ENV USER lighttpd
16ENV GROUP lighttpd
7d5c71d7
L
17ENV GID 911
18ENV UID 911
481ab9a0 19ENV PORT 8080
cd75da69 20ENV SUBFOLDER "/_"
7d5c71d7
L
21
22RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \
b6b31e44 23 apk add -U --no-cache lighttpd
7d5c71d7 24
fd9237eb 25COPY entrypoint.sh /entrypoint.sh
b6b31e44 26COPY lighttpd.conf /lighttpd.conf
d10b219d 27
cd75da69
BW
28COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/
29COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets
220c60cb 30HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
6dd8342b
DV
31 CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1
32
481ab9a0 33EXPOSE ${PORT}
b102c9b2 34VOLUME /www/assets
481ab9a0 35ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]