]>
Commit | Line | Data |
---|---|---|
b9c5fcf0 | 1 | # build stage |
dad372bb | 2 | FROM node:lts-alpine3.19 as build-stage |
b9c5fcf0 BW |
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 | |
dad372bb | 13 | FROM alpine:3.19 |
7d5c71d7 | 14 | |
049f8522 BW |
15 | ENV GID 1000 |
16 | ENV UID 1000 | |
481ab9a0 | 17 | ENV PORT 8080 |
cd75da69 | 18 | ENV SUBFOLDER "/_" |
049f8522 | 19 | ENV INIT_ASSETS 1 |
5b11259d | 20 | ENV IPV6_DISABLE 0 |
7d5c71d7 | 21 | |
049f8522 | 22 | RUN addgroup -S lighttpd -g ${GID} && adduser -D -S -u ${UID} lighttpd lighttpd && \ |
b6b31e44 | 23 | apk add -U --no-cache lighttpd |
7d5c71d7 | 24 | |
049f8522 | 25 | WORKDIR /www |
d10b219d | 26 | |
049f8522 | 27 | COPY lighttpd.conf /lighttpd.conf |
5b11259d | 28 | COPY lighttpd-ipv6.sh /etc/lighttpd/ipv6.sh |
049f8522 BW |
29 | COPY entrypoint.sh /entrypoint.sh |
30 | COPY --from=build-stage --chown=${UID}:${GID} /app/dist /www/ | |
cab7bfd1 | 31 | COPY --from=build-stage --chown=${UID}:${GID} /app/dist/assets /www/default-assets |
049f8522 BW |
32 | |
33 | USER ${UID}:${GID} | |
34 | ||
220c60cb | 35 | HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ |
6dd8342b DV |
36 | CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1 |
37 | ||
481ab9a0 | 38 | EXPOSE ${PORT} |
049f8522 | 39 | |
481ab9a0 | 40 | ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] |