Answer the question
In order to leave comments, you need to log in
Why is docker swarm not letting some requests through?
Hello!
The stack is launched in docker swarm via the command: docker stack deploy -c docker-compose.yml prod
The stack has nginx services (ports 80, 443) and nodejs (port 3000). When accessing both nginx and nodejs, requests are processed through time.
1st request to nginx:
curl -L http://192.168.1.2/ping
curl: (7) Failed to connect to 192.168.105.2 port 80: Нет маршрута до узла
curl -L http://192.168.1.2/ping
{"time":"2018-04-06T11:51:02.869Z","status":"OK"}
version: "3.6"
services:
nginx:
image: nginx:latest
depends_on:
- my-app
ports:
- 80:80
- 443:443
volumes:
#- /etc/letsencrypt:/etc/letsencrypt:ro
- /home/project/data/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- /home/project/data/nginx/conf.d:/etc/nginx/conf.d
- /home/project/public:/var/public
networks:
- my-network
deploy:
placement:
constraints: [node.role == manager]
replicas: 1
update_config:
parallelism: 1
delay: 5s
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
my-app:
image: staging.smartlab.uz:5005/smartlab/ucell/ucell-app
env_file:
- /home/project/project.env
ports:
- 3000:3000
volumes:
- /usr/src/app/node_modules
- /home/project/public:/usr/src/app/public
networks:
- my-network
command: bash -c "npm start"
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 5s
networks:
my-network:
Client:
Version: 18.03.0-ce
API version: 1.37
Go version: go1.9.4
Git commit: 0520e24
Built: Wed Mar 21 23:10:01 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.03.0-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.4
Git commit: 0520e24
Built: Wed Mar 21 23:08:31 2018
OS/Arch: linux/amd64
Experimental: false
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question