2022-03-04 17:40:52 +08:00
|
|
|
FROM --platform=$BUILDPLATFORM node:alpine AS builder
|
2019-11-06 22:29:04 +08:00
|
|
|
WORKDIR /app
|
2022-03-06 17:32:23 +08:00
|
|
|
|
2022-05-08 14:37:00 +08:00
|
|
|
RUN npm i -g pnpm
|
|
|
|
COPY pnpm-lock.yaml package.json .
|
|
|
|
RUN pnpm i
|
2022-03-06 17:32:23 +08:00
|
|
|
|
2019-11-06 22:29:04 +08:00
|
|
|
COPY . .
|
2022-05-08 14:37:00 +08:00
|
|
|
RUN pnpm build \
|
2020-09-05 00:02:53 +08:00
|
|
|
# remove source maps - people like small image
|
2021-06-05 23:09:27 +08:00
|
|
|
&& rm public/*.map || true
|
2019-11-06 22:29:04 +08:00
|
|
|
|
2022-03-04 17:40:52 +08:00
|
|
|
FROM --platform=$TARGETPLATFORM nginx:alpine
|
2019-11-06 22:29:04 +08:00
|
|
|
RUN rm -rf /usr/share/nginx/html/*
|
|
|
|
COPY --from=builder /app/public /usr/share/nginx/html
|
2022-02-13 17:08:28 +08:00
|
|
|
ENV YACD_DEFAULT_BACKEND "http://127.0.0.1:9090"
|
|
|
|
ADD docker-entrypoint.sh /
|
|
|
|
CMD ["/docker-entrypoint.sh"]
|