接口初始化 第一版

This commit is contained in:
yuping
2022-11-22 00:40:29 +08:00
parent d53c2920ed
commit e62fb4cdfd
4 changed files with 87 additions and 1 deletions

67
.drone.yml Normal file
View File

@@ -0,0 +1,67 @@
kind: pipeline
name: fe-str
steps:
- name: restore-cache
image: drillster/drone-volume-cache
settings:
restore: true
mount:
- ./.npm-cache
- ./node_modules
volumes:
- name: cache
path: /cache
- name: npm-install
image: node:16.13.1-alpine
commands:
- npm config set cache ./.npm-cache --global
- npm config set registry http://registry.npm.taobao.org/
- npm install && npm run build
- name: rebuild-cache
image: drillster/drone-volume-cache
settings:
rebuild: true
mount:
- ./.npm-cache
- ./node_modules
volumes:
- name: cache
path: /cache
- name: build-fe-stu
image: plugins/docker
privileged: true
volumes:
- name: registry-auth
path: /root/.docker
- name: dockersock
path: /var/run/docker.sock
settings:
registry: swr.cn-south-1.myhuaweicloud.com
repo: swr.cn-south-1.myhuaweicloud.com/yp/fe-stu
tags: latest
- name: release
image: docker:dind
volumes:
- name: dockersock
path: /var/run/docker.sock
- name: registry-auth
path: /root/.docker
commands:
- docker stack deploy -c docker-compose.yml fe-stu --with-registry-auth
volumes:
- name: cache
host:
path: /tmp/cache
- name: dockersock
host:
path: /var/run/docker.sock
- name: registry-auth
host:
path: /root/.docker

6
Dockerfile Normal file
View File

@@ -0,0 +1,6 @@
FROM devforth/spa-to-http:latest
WORKDIR /
ADD ./dist .
EXPOSE 8080

13
docker-compose.yml Normal file
View File

@@ -0,0 +1,13 @@
version: "3"
services:
buyer-ui-mro84:
image: swr.cn-south-1.myhuaweicloud.com/yp/fe-stu
networks:
- traefik
deploy:
mode: replicated
replicas: 1
networks:
traefik:
external: true

View File

@@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "vite",
"serve": "vite build && vite preview",
"server": "vite build && vite preview",
"build": "vite build"
},
"dependencies": {