2021-06-03 23:40:34 +03:00
|
|
|
# build stage
|
2021-04-17 20:42:38 +03:00
|
|
|
FROM node:lts-alpine as build-stage
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2021-06-03 23:40:34 +03:00
|
|
|
COPY package*.json ./
|
|
|
|
RUN yarn install --frozen-lockfile
|
2021-04-17 20:42:38 +03:00
|
|
|
|
|
|
|
COPY . .
|
|
|
|
RUN yarn build
|
|
|
|
|
2021-06-03 23:40:34 +03:00
|
|
|
# production stage
|
|
|
|
FROM alpine:3.11
|
|
|
|
|
|
|
|
ENV USER darkhttpd
|
|
|
|
ENV GROUP darkhttpd
|
|
|
|
ENV GID 911
|
|
|
|
ENV UID 911
|
|
|
|
ENV PORT 8080
|
2021-05-24 22:46:58 +03:00
|
|
|
|
2021-06-03 23:40:34 +03:00
|
|
|
RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \
|
|
|
|
apk add -U --no-cache su-exec darkhttpd
|
2021-04-17 20:42:38 +03:00
|
|
|
|
2021-06-03 23:40:34 +03:00
|
|
|
COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/
|
|
|
|
COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets
|
|
|
|
COPY entrypoint.sh /entrypoint.sh
|
2021-04-17 20:42:38 +03:00
|
|
|
|
2021-05-24 22:46:58 +03:00
|
|
|
EXPOSE ${PORT}
|
2021-06-03 23:40:34 +03:00
|
|
|
VOLUME /www/assets
|
|
|
|
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]
|