Home > other >  Use the docker compose command to start the service cannot be accessed
Use the docker compose command to start the service cannot be accessed

Time:11-07

Technical background: docker + nacos + spring cloud alibaba
Consumer: gateway: 0.1
Producer: server:
0.1Image list as follows:


A, command to start
If you use a command to start the:
Docker run - d - 9080 p: 9080 gateway:
0.1Docker run - d - 8080 p: 8080 server:
0.1Two will be registered to the nacos, and can be normal visit, all above normal
The browser to http://ip:9080/url, the server-side data normal return
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Second, compose start plan
1, the docker - compose. Yml content is as follows:
 
Version: '3.5'
Services:
Gateway:
Image: 'gateway: 0.1'
Ports:
- '9080-9080


2, docker - compose up start, service log normal
3, the browser to http://ip:9080/url, the gateway container log rolling, can request to the gateway container, but you can't access server service, registered in nacos error IO error, error code 500, and then the connection timeout!!!!! This card for me for a few days


As long as it is used the services of a docker - compose start, both the client and the server is inaccessible;
Use the docker the run command is normal
Container list is the same, as shown in figure:


  • Related