chore: docker
This commit is contained in:
parent
96d31c24bd
commit
43755e89da
24
Dockerfile
24
Dockerfile
|
@ -1,18 +1,20 @@
|
||||||
FROM node:16-alpine as build-stage
|
FROM node:18-bullseye
|
||||||
|
|
||||||
WORKDIR /app
|
RUN mkdir -p /web
|
||||||
RUN corepack enable
|
|
||||||
|
|
||||||
COPY .npmrc package.json pnpm-lock.yaml ./
|
COPY . /web
|
||||||
RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store \
|
|
||||||
pnpm install --frozen-lockfile
|
WORKDIR /web
|
||||||
|
|
||||||
|
RUN npm config set registry https://registry.npm.taobao.org
|
||||||
|
RUN npm install -g pnpm
|
||||||
|
RUN pnpm install
|
||||||
|
|
||||||
COPY . .
|
|
||||||
RUN pnpm build
|
RUN pnpm build
|
||||||
|
|
||||||
FROM nginx:stable-alpine as production-stage
|
ENV HOST 0.0.0.0
|
||||||
|
ENV PORT 3000
|
||||||
|
|
||||||
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
EXPOSE 3000
|
||||||
EXPOSE 80
|
|
||||||
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["pnpm", "start"]
|
||||||
|
|
Loading…
Reference in New Issue