问题描述
我创建了以下 docker 镜像
# Stage 0,"build-stage",based on Node.js,to build and compile the frontend
FROM tianGolo/node-frontend:10 as build-stage
workdir /app
copY package*.json /app/
RUN npm install
copY ./ /app/
RUN CI=true npm test
RUN npm run build
# Stage 1,based on Nginx,to have only the compiled app,ready for production with Nginx
FROM Nginx:1.15
copY --from=build-stage /app/build/ /usr/share/Nginx/html
# copy the default Nginx.conf provided by tianGolo/node-frontend
copY ./Nginx.conf /etc/Nginx/conf.d/v2.myapp.io
Nginx.conf 在哪里
server {
listen 80;
server_name serverip v2.myapp.io www.v2.myapp.io;
location / {
root /usr/share/Nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
include /etc/Nginx/extra-conf.d/*.conf;
}
然后我执行以下 sh
docker build -t mycontainer .
docker push mycontainer:latest
ssh root@ip 'docker pull mycontainer:latest'
ssh root@ip 'docker stop mycontainer'
ssh root@ip 'docker rm mycontainer'
ssh root@ip 'sudo docker run -p 8080:80 -it -d --name mycontainer mycontainer'
它工作正常,但地址 v2.myapp.io 指向一个空白的 Nginx 页面,所以我想我有某种配置错误。但我不确定还会发生什么
有人可以帮忙解决这个问题吗?
我记得当我过去手动完成所有这些时,我有一个启用站点的文件夹和一个可用的站点文件夹,我尝试创建它们并将 Nginx.conf 文件放入但我没有运气
那里出了什么问题?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)