]>
Commit | Line | Data |
---|---|---|
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.11 | |
14 | ||
15 | ENV USER darkhttpd | |
16 | ENV GROUP darkhttpd | |
17 | ENV GID 911 | |
18 | ENV UID 911 | |
19 | ENV PORT 8080 | |
20 | ||
21 | RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ | |
22 | apk add -U --no-cache su-exec darkhttpd | |
23 | ||
24 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ | |
25 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets | |
26 | COPY entrypoint.sh /entrypoint.sh | |
27 | ||
28 | EXPOSE ${PORT} | |
29 | VOLUME /www/assets | |
30 | ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] |