0

I have application and Jenkins containers running on my droplet. I have two docker containers like that:

enter image description here

8081 port is open and I can open Jenkins, but 8080 port stay closed(it's closed when I check it on www.yougetsignal.com). I can't open it. what is the problem?

this is docker-compose.yml file:

 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:

and application 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
O. Shekriladze
  • 1,346
  • 1
  • 19
  • 36
  • Are you sure that your application inside the container listens runs on 8080? Can you double check that by running this inside the container: http://localhost:8080? – Mihai May 10 '19 at 16:36
  • yes I am sure, it works for localhost:8080 – O. Shekriladze May 10 '19 at 17:06
  • If I look at your printscreen port 8081 is not even open, but you say it is open. Also have you tried ports other than 8080? For me your setup looks good. And is you can curl your application inside the container then that works as well. – Mihai May 10 '19 at 17:13
  • What does `netstat -nltp` say? – Oliver May 10 '19 at 20:05
  • do you have custom firewall roles in the Digital Ocean's control panel? I had similar issue https://stackoverflow.com/questions/56117774/digital-ocean-open-port-8080-for-spring-boot-application – Anton Belev May 14 '19 at 12:42

0 Answers0