2023-02-16 07:25:29 -05:00
|
|
|
# build front-end
|
|
|
|
FROM node:lts-alpine AS builder
|
2023-02-16 00:39:07 -05:00
|
|
|
|
|
|
|
COPY ./ /app
|
|
|
|
WORKDIR /app
|
|
|
|
|
2023-03-09 04:52:39 -05:00
|
|
|
RUN apk add --no-cache git \
|
|
|
|
&& npm install pnpm -g \
|
|
|
|
&& pnpm install \
|
|
|
|
&& pnpm run build \
|
|
|
|
&& rm -rf /root/.npm /root/.pnpm-store /usr/local/share/.cache /tmp/*
|
2023-02-16 07:25:29 -05:00
|
|
|
|
|
|
|
# service
|
|
|
|
FROM node:lts-alpine
|
|
|
|
|
|
|
|
COPY /service /app
|
|
|
|
COPY --from=builder /app/dist /app/public
|
|
|
|
|
2023-02-16 00:39:07 -05:00
|
|
|
WORKDIR /app
|
2023-03-09 04:52:39 -05:00
|
|
|
RUN apk add --no-cache git \
|
|
|
|
&& npm install pnpm -g \
|
|
|
|
&& pnpm install --only=production \
|
|
|
|
&& rm -rf /root/.npm /root/.pnpm-store /usr/local/share/.cache /tmp/*
|
|
|
|
|
2023-02-16 00:39:07 -05:00
|
|
|
|
|
|
|
EXPOSE 3002
|
|
|
|
|
2023-03-09 04:52:39 -05:00
|
|
|
CMD ["pnpm", "run", "start"]
|