php ci vue,gitlab ci 部署vue项目

记录一下其中的三个配置文件。

.gitlab-ci.yml

image: xxx/docker/node:10.12.0-alpine

stages:

- build

- deploy

cache:

key: ${CI_COMMIT_REF_NAME}

paths:

- node_modules/

job-build:

stage: build

only:

- master

- feature/init

tags:

- shell

script:

- npm set registry https://registry.npm.taobao.org

- npm install --progress=false

- npm run build

artifacts:

expire_in: 1 week

paths:

- dist

job-release:

stage: deploy

only:

- master

tags:

- shell

script:

- docker build -t xxx/dashboard/dashboard:${CI_COMMIT_SHA:0:8} .

- docker login -u $DOCKER_USER -p $DOCKER_PASSWORD docker-registry.xxx

- docker push xxx/dashboard/dashboard:${CI_COMMIT_SHA:0:8}

when: manual

Dockerfile

FROM xxx/docker/nginx:1.13.6

COPY ./dist /var/www/html

COPY ./im-dashboard.conf /etc/nginx/conf.d/

RUN rm /etc/nginx/conf.d/default.conf

EXPOSE 80

CMD ["nginx","-g","daemon off;"]

im-dashboard.conf

server {

listen 80;

listen [::]:80;

# 接口服务的IP地址

server_name im-dashboard.xxx;

charset utf-8;

access_log off;

# ElecManageSystem-应用文件夹名称 app-index.html页面所在文件夹

root /var/www/html;

index index.html;

location / {

try_files $uri $uri/ /index.html;

}

location /getChartData {

proxy_pass http://xxx/c/dashboard/getChartData;

proxy_set_header Cookie $http_cookie;

}

location /getMetricNameMap {

proxy_pass http://xxx/c/dashboard/getMetricNameMap;

proxy_set_header Cookie $http_cookie;

}

location /getGradeList {

proxy_pass http://xxx/c/dashboard/getGradeList;

proxy_set_header Cookie $http_cookie;

}

location /initQuery {

proxy_pass http://xxx/c/projectListener/initQuery;

proxy_set_header Cookie $http_cookie;

}

location /getTotalLayer {

proxy_pass http://xxx/c/Metric/getTotalLayer;

proxy_set_header Cookie $http_cookie;

}

location /findGroupByPidAndPager {

proxy_pass http://xxx/api/group/findGroupByPidAndPager;

}

location /findHostBygroupId {

proxy_pass http://xxx/api/group/findHostBygroupId;

}

location /v1 {

proxy_pass http://xxx/api/v1;

}

error_page 500 502 503 504 /50x.html;

location = /50x.html {

root html;

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值