Hi!
Is there any additional configuration necessary to get networking to work on docker stack and docker compose in ubuntu 20.04?
I’m trying to run a stack with our applications on a server with Ubuntu 20.04 on it, but even though I indicate the port mapping correctly in the docker-compose.yml file, ports are not listening correctly and the browser gets no answer. I’ve tried with both the nginx and portainer official images.
If I run docker run -p 80:80 -p 443:443 nginx
, I can then access http://<my_server_ip>
and see the nginx welcome page. The same goes for portainer: docker run -p 80:9000 -p 443:9443 portainer/portainer-ce
and http://<my_server_ip>
shows the portainer login page.
But, when I try to do the same with compose:
# docker-compose.yaml for nginx
version: "3"
services:
nginx:
image: nginx
ports:
- 80:80
- 443:443
# docker-compose.yaml for portainer
version: "3"
services:
portainer:
image: portainer/portainer-ce
ports:
- 80:9000
- 443:9443
I get no response in the browser when I go to http://<my_server_ip>
. I’ve tried both with docker-compose up
and docker stack deploy -c docker-compose.yaml portainer|nginx
(used nginx in the first experiment and portainer in the second one).
Any help would be very much appreciated as this issue has come at quite a critical time