MithunTechnologiesDevOps / spring-boot-mongo-docker

48 stars 5.34k forks source link

Docker Compose Not Working #13

Open atb-brown opened 3 years ago

atb-brown commented 3 years ago

My apologies in advance, but I'm not a Docker expert. But following the outline in this project's readme doesn't result in a running service for me right now.

When running docker-compose up, I get the following output with an error:

$ docker-compose up -d
WARNING: The following deploy sub-keys are not supported and have been ignored: update_config, restart_policy.delay
Creating spring-boot-mongo-docker2_mongo_1 ... done
WARNING: The "springboot" service specifies a port on the host. If multiple containers for this service are created on a single host, the port will clash.
Creating spring-boot-mongo-docker2_springboot_1 ...
Creating spring-boot-mongo-docker2_springboot_1 ... done
Creating spring-boot-mongo-docker2_springboot_2 ... error

ERROR: for spring-boot-mongo-docker2_springboot_2  Cannot start service springboot: driver failed programming external connectivity on endpoint spring-boot-mongo-docker2_springboot_2 (0de9d86e641a3499f3647fd1636842995eb7d19745cfa62e
541f56dad5b9525e): Bind for 0.0.0.0:8080 failed: port is already allocated

ERROR: for springboot  Cannot start service springboot: driver failed programming external connectivity on endpoint spring-boot-mongo-docker2_springboot_2 (0de9d86e641a3499f3647fd1636842995eb7d19745cfa62e541f56dad5b9525e): Bind for
0.0.0.0:8080 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.

It seems to be complaining that 0.0.0.0:8080 is already being used, but I used a TCP port viewer and that doesn't seem to be the case on my computer.

ramazansakin commented 3 years ago

Hi @atb-brown ,

As you see at the docker-compose file, 2 instances of the app are trying to run on the same port and then one of them can not run. You can simplify the compose file like this: