我的应用程序和Jenkins容器在我的Droplet上运行。我有两个这样的Docker容器:
8081端口已打开,我可以打开Jenkins,但是8080端口保持关闭状态(当我在www.yougetsignal.com上对其进行检查时,该端口已关闭)。我打不开有什么问题吗?
这是docker-compose.yml文件:
version: '2'
services:
web_app:
build:
context: .
dockerfile: ./Docker/Dockerfile
container_name: web_app
restart: unless-stopped
ports:
- 8080:8080
networks:
- net
jenkins:
image: jenkinsci/blueocean
container_name: jenkins
volumes:
- "/var/www/jenkins/jenkins_home:/var/jenkins_home"
- "/var/run/docker.sock:/var/run/docker.sock"
- "/var/www/jenkins:/home"
ports:
- "8081:8080"
networks:
- net
networks:
net:
和应用程序Dockerfile:
# Stage 1
FROM node:10.15-alpine as node
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# Stage 2
FROM nginx:1.13.12-alpine
COPY --from=node /usr/src/app/dist/oshop /usr/share/nginx/html
COPY Docker/nginx.conf /etc/nginx/conf.d/default.conf