feat: Docker

This commit is contained in:
陶林 2024-03-01 09:34:20 +08:00
parent 10ed284461
commit a0cd8cf472
3 changed files with 6867 additions and 5 deletions

View File

@ -4,12 +4,15 @@ 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"
RUN npm config set registry https://registry.npm.taobao.org
RUN npm install -g nrm
RUN npm install -g pnpm
RUN nrm use tencent
COPY package.json ./package.json
RUN npm install
COPY . .
RUN npm run build
RUN rm -rf node_modules && rm package-lock.json
RUN npm install --production
RUN pnpm install
RUN pnpm run build
RUN rm -rf node_modules && rm pnpm-lock.yaml
RUN pnpm install --prod
EXPOSE 3000
CMD ["npm", "run", "start"]

7
docker-compose.yml Normal file
View File

@ -0,0 +1,7 @@
version: '3.5'
services:
server:
build: .
container_name: 'midway_test'
ports:
- 3000:3000

6852
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load Diff