necore api docker vue nginx
2021-01-25 06:17
标签:htm doc use soft outer spn listen bash tco 1. netcore api 部署 docker 不能指定 端口 //.UseUrls("http://10.43.21.156:8081") 2,vue nginx 前端访问 api nginx的配置 proxy_pass转发的路径后是否带 “/” 的意义都是不一样的(https://www.jianshu.com/p/55c0b967e1a4) 3.netcore dockerfile FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base COPY . . docker build -t vtmsapi . docker run --name vtmsapi -d -p 8081:80 vtmsapi 4.vue nginx docker dockerfile server { error_page 500 502 503 504 /50x.html; docker pull nginx:latest docker build -t vtmsadmin . docker run --name vtmsadmin -d -p 8091:80 vtmsadmin docker exec -it 7b1fe4f989c4 /bin/bash curl localhost:8081 necore api docker vue nginx 标签:htm doc use soft outer spn listen bash tco 原文地址:https://www.cnblogs.com/yyzyou/p/12028982.html
WORKDIR /app
EXPOSE 80
ENTRYPOINT ["dotnet", "VTMS.Core.dll"]
listen 80;
#charset koi8-r;
access_log /var/log/nginx/host.access.log;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html; # 这个非常重要,采用vue-router的时候,必须配置这个
}
##配置后端api映射
location ^~ /api/{
proxy_pass http://10.43.21.156:8081;
}
location = /50x.html {
root /usr/share/nginx/html;
}
}
docker run --name nginx -p 8080:80 -d nginx
docker kill $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker rmi $(docker images -q)
docker rmi -f
文章标题:necore api docker vue nginx
文章链接:http://soscw.com/index.php/essay/46676.html