Skip to content

Commit

Permalink
Merge pull request #44 from terwer/v4.x
Browse files Browse the repository at this point in the history
Add to nginx
  • Loading branch information
terwer authored Mar 15, 2019
2 parents 289ad94 + 1b52a9e commit 7fa25bd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
10 changes: 5 additions & 5 deletions jvue-admin/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#依赖的镜像
FROM node:10.15.1-alpine

# CDN注册
RUN npm config set registry https://registry.npm.taobao.org && \
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver && \
npm cache clean --force

# 工作目录
WORKDIR /app
Expand All @@ -14,7 +10,11 @@ COPY ./jvue-front/package.json ./

# 因为被墙,单独安装
ENV SASS_BINARY_SITE https://npm.taobao.org/mirrors/node-sass
RUN npm install node-sass && npm install
# CDN注册
RUN npm config set registry https://registry.npm.taobao.org && \
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver && \
npm cache clean --force && \
npm install node-sass && npm install

# 注意这个一定要要在npm install后面,否则devDependencies的包无法安装
ENV HOST 0.0.0.0
Expand Down
10 changes: 5 additions & 5 deletions jvue-front/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#依赖的镜像
FROM node:10.15.1-alpine

# CDN注册
RUN npm config set registry https://registry.npm.taobao.org && \
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver && \
npm cache clean --force

# 工作目录
WORKDIR /app
Expand All @@ -14,7 +10,11 @@ COPY ./jvue-front/package.json ./

# 因为被墙,单独安装
ENV SASS_BINARY_SITE https://npm.taobao.org/mirrors/node-sass
RUN npm install node-sass && npm install
# CDN注册
RUN npm config set registry https://registry.npm.taobao.org && \
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver && \
npm cache clean --force && \
npm install node-sass && npm install

# 注意这个一定要要在npm install后面,否则devDependencies的包无法安装
ENV HOST 0.0.0.0
Expand Down
11 changes: 10 additions & 1 deletion jvue-nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@ server {
listen 80;
charset utf-8;

location / {
proxy_pass http://jvue-front:3000/; #jvue-front 前台
index index.html index.htm;
}

location /admin {
proxy_pass http://jvue-admin:3001/; #jvue-admin 后台
}

location /api/ {
proxy_set_header X-Real-IP $remote_addr; # 转发用户IP
proxy_set_header X-Real-IP $remote_addr; # 接口服务器
proxy_pass http://jvue-server:8081; # jvue-server
}

Expand Down

0 comments on commit 7fa25bd

Please sign in to comment.