]> git.immae.eu Git - github/bastienwirtz/homer.git/blame - Dockerfile
Apply suggestions from code review
[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
7d5c71d7
L
13FROM alpine:3.11
14
fc69081c
L
15ENV USER darkhttpd
16ENV GROUP darkhttpd
7d5c71d7
L
17ENV GID 911
18ENV UID 911
481ab9a0 19ENV PORT 8080
7d5c71d7
L
20
21RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \
22 apk add -U darkhttpd
23
d10b219d 24COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/
29d6b359 25COPY --chown=${USER}:${GROUP} entrypoint.sh /entrypoint.sh
449858fb 26COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets
d10b219d 27
29d6b359 28USER ${USER}
481ab9a0 29EXPOSE ${PORT}
a7ba289e 30VOLUME [ "/www/assets" ]
481ab9a0 31ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]