我的目标是跑
角度应用
集装箱内
恩吉克斯
.
我希望包含应用程序的容器位于我的主机网络中。
这是我的档案:
# Stage 1
FROM node:10.11.0-alpine as node
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Stage 2
FROM nginx:1.14-alpine
COPY --from=node /usr/src/app/dist/gui /usr/share/nginx/html
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
NGNX.CONF:
server {
listen 80;
server_name 127.0.0.1;
location / {
root /usr/share/nginx/html;
index index.html index.html;
try_files $uri $uri/ /index.html =404;
}
location /api {
proxy_pass http://localhost:8080/api;
}
}
还有我的docker-compose.yml文件:
version: "3.5"
services:
gui:
container_name: gui
network_mode: "host"
build:
context: gui
$ docker-compose up
启动容器。
但是现在什么都没有
本地主机:80
.
问题在哪里?nginx不提供应用程序吗?