yacd/Dockerfile

19 lines
478 B
Docker
Raw Normal View History

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 \
# remove source maps - people like small image
&& rm public/*.map || true
2019-11-06 22:29:04 +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
ENV YACD_DEFAULT_BACKEND "http://127.0.0.1:9090"
ADD docker-entrypoint.sh /
CMD ["/docker-entrypoint.sh"]