CI 测试

This commit is contained in:
iVamp 2023-10-24 20:17:54 +08:00
parent d5421c2f0d
commit d1b093ab30
3 changed files with 12 additions and 13 deletions

View File

@ -1,3 +1,13 @@
build-js:
image: node:20
stage: build
script:
- npm config set registry https://registry.npm.taobao.org/
- npm install
- npm run build
artifacts:
paths:
- dist/
docker-build:
image: docker:latest
stage: build

View File

@ -2,18 +2,7 @@ FROM node:20
LABEL authors="ivamp"
WORKDIR /app
# 忽略 node_modules 目录
COPY src /app/src
COPY package.json /app/package.json
COPY .env.example /app/.env.example
COPY main.ts /app/main.ts
COPY tsconfig.json /app/tsconfig.json
RUN npm config set registry https://registry.npm.taobao.org/
RUN npm install
RUN npm run build
ADD ./dist /app
EXPOSE 3000

View File

@ -7,6 +7,6 @@ const port = process.env.PORT || 3000
app.listen(port, () => {
console.log(`Server is running at http://0.0.0.0:${port}`)
console.log(`You can visit http://localhost:${port}`)
console.log(`For test, you can visit http://localhost:${port}`)
console.log(`Press CTRL-C to stop \n`)
})