2024-03-01 09:19:49 +08:00
|
|
|
|
|
|
|
FROM node:lts-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
RUN sed -i "s@http://dl-cdn.alpinelinux.org/@https://repo.huaweicloud.com/@g" /etc/apk/repositories
|
|
|
|
RUN apk add --no-cache tzdata
|
|
|
|
ENV TZ="Asia/Shanghai"
|
2024-03-01 09:34:20 +08:00
|
|
|
RUN npm install -g nrm
|
|
|
|
RUN npm install -g pnpm
|
|
|
|
RUN nrm use tencent
|
2024-03-01 09:19:49 +08:00
|
|
|
COPY package.json ./package.json
|
|
|
|
COPY . .
|
2024-03-01 09:34:20 +08:00
|
|
|
RUN pnpm install
|
|
|
|
|
|
|
|
RUN pnpm run build
|
|
|
|
RUN rm -rf node_modules && rm pnpm-lock.yaml
|
|
|
|
RUN pnpm install --prod
|
2024-03-01 09:19:49 +08:00
|
|
|
EXPOSE 3000
|
|
|
|
CMD ["npm", "run", "start"]
|