CI 测试
This commit is contained in:
parent
d5421c2f0d
commit
d1b093ab30
@ -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
|
||||
|
13
Dockerfile
13
Dockerfile
@ -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
|
||||
|
||||
|
2
main.ts
2
main.ts
@ -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`)
|
||||
})
|
Loading…
Reference in New Issue
Block a user