yacd/Dockerfile

23 lines
587 B
Docker
Raw Permalink Normal View History

2023-01-30 20:52:43 +08:00
ARG COMMIT_SHA=""
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 ./
COPY ./patches/ ./patches/
2022-05-08 14:37:00 +08:00
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
2022-05-08 22:47:42 +08:00
COPY docker/nginx-default.conf /etc/nginx/conf.d/default.conf
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"]