-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from batizhao/dev
Dev
- Loading branch information
Showing
5 changed files
with
90 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM node:14.15.3-alpine3.12 as builder | ||
WORKDIR /usr/src/app/ | ||
COPY package.json ./ | ||
RUN npm install --registry=https://registry.npm.taobao.org | ||
COPY ./ ./ | ||
RUN npm run build | ||
|
||
|
||
FROM nginx | ||
WORKDIR /usr/share/nginx/html/ | ||
COPY ./docker/nginx.conf /etc/nginx/conf.d/default.conf | ||
COPY --from=builder /usr/src/app/dist /usr/share/nginx/html/ | ||
EXPOSE 80 | ||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
node { | ||
def build_tag | ||
def registry_addr = "harbor.pecado.com" | ||
def maintainer_name = "pecado" | ||
def image | ||
def version = "1.2" | ||
|
||
stage('Git Clone') { | ||
git branch: 'dev', credentialsId: 'github', url: '[email protected]:batizhao/pecado-ui.git' | ||
} | ||
|
||
stage('Build Docker Image') { | ||
build_tag = sh(returnStdout: true, script: 'git rev-parse --short HEAD').trim() | ||
image_name = "${registry_addr}/${maintainer_name}/ui:${version}-${build_tag}" | ||
image = docker.build(image_name) | ||
} | ||
|
||
stage('Push Docker Image') { | ||
docker.withRegistry('https://harbor.pecado.com', 'harbor-jiangsu-auth') { | ||
image.push() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
server { | ||
listen 80; | ||
|
||
gzip on; | ||
gzip_min_length 1k; | ||
gzip_comp_level 9; | ||
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png; | ||
gzip_vary on; | ||
gzip_disable "MSIE [1-6]\."; | ||
|
||
# 打包好的dist目录文件,放置到这个目录下 | ||
root /usr/share/nginx/html; | ||
|
||
location / { | ||
# 用于配合 browserHistory使用 | ||
try_files $uri $uri/ /index.html; | ||
|
||
# 如果有资源,建议使用 https + http2,配合按需加载可以获得更好的体验 | ||
# rewrite ^/(.*)$ https://preview.pro.ant.design/$1 permanent; | ||
} | ||
|
||
location /api { | ||
proxy_pass http://pecado-gateway:8080; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters