Browse Source

update

master
Soleilw 1 year ago
parent
commit
875f05109b
5 changed files with 128 additions and 0 deletions
  1. 69
    0
      .drone.yml
  2. 23
    0
      Dockerfile
  3. 7
    0
      docker-compose-test.yml
  4. 7
    0
      docker-compose.yml
  5. 22
    0
      tsconfig.json

+ 69
- 0
.drone.yml View File

kind: pipeline
type: docker
name: publish-prod-v1

clone:
disable: true
steps:
- name: publish-prod-v1
image: scfobao/dronessh:v1
settings:
host:
- 114.132.85.7

username:
from_secret: SSH_USERNAME
password:
from_secret: SSH_PASSWORD

port: 22
command_timeout: 30m
script:
- cd /home/lqh/apps/rcsc-web
- git fetch --all
- git reset --hard origin/master
# - docker-compose build
# - docker-compose push
# - docker pull registry.cn-hangzhou.aliyuncs.com/anyu1/rcsc:rcsc_web_prod_latest
# - docker-compose -f /home/lqh/apps-yml/dc-rcsc-api.yaml up -d --force-recreate
when:
branch:
- master


---
kind: pipeline
type: docker
name: publish-test


clone:
disable: true
steps:


- name: publish-test-build-push
image: scfobao/dronessh:v1
settings:
host:
- 114.132.85.7
username:
from_secret: SSH_USERNAME
password:
from_secret: SSH_PASSWORD
port: 22
command_timeout: 30m
script:
- cd /home/lqh/apps/rcsc-web
- git fetch --all
- git reset --hard origin/test
- docker-compose -f docker-compose-test.yml build
# - docker-compose -f docker-compose-test.yml push
# - docker pull registry.cn-hangzhou.aliyuncs.com/anyu1/rcsc:rcsc_web_test_latest
- sleep 1
- docker-compose -f /home/lqh/apps-yml/dc-rcsc-web.yaml up -d --force-recreate
- docker system prune -f --filter "label!=17"
when:
branch:
- test

+ 23
- 0
Dockerfile View File

# 使用 Node 作为基础镜像
FROM node:17

# 设置工作目录
WORKDIR /app

# 拷贝package.json和package-lock.json
COPY package*.json ./

# 安装依赖
RUN npx vite build

# 将项目文件拷贝到工作目录
COPY . .

# 构建项目
RUN npm run build

# 暴露端口
EXPOSE 3000

# 启动应用
CMD ["npm", "run", "serve"]

+ 7
- 0
docker-compose-test.yml View File

version: "3.3"
services:
api:
build:
context: .
dockerfile: ./Dockerfile
image: registry.cn-hangzhou.aliyuncs.com/anyu1/rcsc:rcsc_web_test_latest

+ 7
- 0
docker-compose.yml View File

version: "3.3"
services:
api:
build:
context: .
dockerfile: ./Dockerfile
image: registry.cn-hangzhou.aliyuncs.com/anyu1/rcsc:rcsc_web_prod_latest

+ 22
- 0
tsconfig.json View File

{ {
<<<<<<< HEAD
"compilerOptions": { "compilerOptions": {
"target": "ES2020", "target": "ES2020",
"useDefineForClassFields": true, "useDefineForClassFields": true,
"isolatedModules": true, "isolatedModules": true,
"noEmit": true, "noEmit": true,
"jsx": "preserve", "jsx": "preserve",
=======
"compilerOptions": {
"target": "ES2020",
"allowJs": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
"baseUrl": "./",
"paths": {"@/*": ["src/*"]},
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
>>>>>>> 6c4d04ce0fb07ed8d08e7591b501c6715e56639a


/* Linting */ /* Linting */
"strict": true, "strict": true,

Loading…
Cancel
Save