SliverHorn
4 years ago
8 changed files with 157 additions and 91 deletions
-
26.docker-compose/nginx/conf.d/my.conf
-
52.docker-compose/shell/server-handle.sh
-
10.docker-compose/shell/web-handle.sh
-
80README.md
-
20docker-compose.yaml
-
0docker/docker-start.sh
-
40dockerfile_server
-
20dockerfile_web
@ -0,0 +1,26 @@ |
|||||
|
server { |
||||
|
listen 8000; |
||||
|
server_name localhost; |
||||
|
|
||||
|
#charset koi8-r; |
||||
|
#access_log logs/host.access.log main; |
||||
|
|
||||
|
location / { |
||||
|
root /usr/share/nginx/html; |
||||
|
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; |
||||
|
try_files $uri $uri/ /index.html; |
||||
|
} |
||||
|
|
||||
|
location /api { |
||||
|
proxy_set_header Host $http_host; |
||||
|
proxy_set_header X-Real-IP $remote_addr; |
||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
||||
|
proxy_set_header X-Forwarded-Proto $scheme; |
||||
|
rewrite ^/api/(.*)$ /$1 break; #重写 |
||||
|
proxy_pass http://172.25.0.4:8888; # 设置代理服务器的协议和地址 |
||||
|
} |
||||
|
|
||||
|
location /api/swagger/index.html { |
||||
|
proxy_pass http://127.0.0.1:8888/swagger/index.html; |
||||
|
} |
||||
|
} |
@ -1,10 +0,0 @@ |
|||||
#! /bin/bash |
|
||||
|
|
||||
rm -f .env.production |
|
||||
touch .env.production |
|
||||
filename="./.env.production" |
|
||||
cat>"${filename}"<<EOF |
|
||||
ENV = 'production' |
|
||||
VUE_APP_BASE_API = '' |
|
||||
EOF |
|
||||
|
|
@ -0,0 +1,20 @@ |
|||||
|
FROM node:12.16.1 |
||||
|
|
||||
|
WORKDIR /gva_web/ |
||||
|
COPY web/ . |
||||
|
|
||||
|
RUN npm install -g cnpm --registry=https://registry.npm.taobao.org |
||||
|
RUN cnpm install || npm install |
||||
|
RUN npm run build |
||||
|
|
||||
|
FROM nginx:alpine |
||||
|
LABEL MAINTAINER="SliverHorn@sliver_horn@qq.com" |
||||
|
|
||||
|
COPY .docker-compose/nginx/conf.d/my.conf /etc/nginx/conf.d/my.conf |
||||
|
COPY --from=0 /gva_web/dist /usr/share/nginx/html |
||||
|
RUN cat /etc/nginx/nginx.conf |
||||
|
RUN cat /etc/nginx/conf.d/my.conf |
||||
|
RUN ls -al /usr/share/nginx/html |
||||
|
CMD ls -al /usr/share/nginx/html |
||||
|
|
||||
|
CMD ['nginx-debug', '-g', 'daemon off;'] |
Write
Preview
Loading…
Cancel
Save
Reference in new issue