feat: Docker
This commit is contained in:
parent
10ed284461
commit
a0cd8cf472
13
Dockerfile
13
Dockerfile
@ -4,12 +4,15 @@ WORKDIR /app
|
|||||||
RUN sed -i "s@http://dl-cdn.alpinelinux.org/@https://repo.huaweicloud.com/@g" /etc/apk/repositories
|
RUN sed -i "s@http://dl-cdn.alpinelinux.org/@https://repo.huaweicloud.com/@g" /etc/apk/repositories
|
||||||
RUN apk add --no-cache tzdata
|
RUN apk add --no-cache tzdata
|
||||||
ENV TZ="Asia/Shanghai"
|
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
|
COPY package.json ./package.json
|
||||||
RUN npm install
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm run build
|
RUN pnpm install
|
||||||
RUN rm -rf node_modules && rm package-lock.json
|
|
||||||
RUN npm install --production
|
RUN pnpm run build
|
||||||
|
RUN rm -rf node_modules && rm pnpm-lock.yaml
|
||||||
|
RUN pnpm install --prod
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
CMD ["npm", "run", "start"]
|
CMD ["npm", "run", "start"]
|
7
docker-compose.yml
Normal file
7
docker-compose.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
version: '3.5'
|
||||||
|
services:
|
||||||
|
server:
|
||||||
|
build: .
|
||||||
|
container_name: 'midway_test'
|
||||||
|
ports:
|
||||||
|
- 3000:3000
|
6852
pnpm-lock.yaml
Normal file
6852
pnpm-lock.yaml
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user