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