Skip to content

liumapp/docker-compose-demo

Repository files navigation

docker-compose-demo

A simple Docker Compose Demo for Spring Cloud Project .

中文文档

how to use

  • build maven project and push them into docker by running "build-images.sh"

    if you are successful , you can find this :

    build-images.jpg

  • running project by using docker-compose :

      docker-compose up -d
    

    if you are successful , you can find this :

    run-docker-compose

    and you can find container list in your Docker pannel :

    after-run.jpg

  • stop all the project by running :

      docker-compose down          
    
  • if you changed the code , plz run :

      docker-compose down 
      
      ./rm-images.sh
      
      ./build-image.sh
      
      docker-compose up
    

    the ./rm-images.sh will remove the Image from Docker :

    rm.jpg

    the ./build-image.sh will package your project and upload it to Docker .

    before you run ./build-image.sh , your Docker pannel should be look like this :

    before-install.jpg

    after your run ./build-image.sh , your Docker pannel should be look like this :

    after-install.jpg

  • plz pay attention , if you want to debug in IDEA , you need set your hosts file :

      127.0.0.1 docker-compose-eureka
      127.0.0.1 docker-compose-config
      127.0.0.1 docker-compose-gateway
      127.0.0.1 demo-api-a
      127.0.0.1 demo-api-b                
    

    But jut running in Docker , you do not need set this .

running demo

  • Eureka pannel should be look like this :

    eureka/jpg

  • config server should be look like this :

    config.jpg

  • visit demo-api-a throw zuul gateway should be look like this :

    demo-api-a.jpg

  • visit demo-api-b throw zuul gateway should be look like this :

    demo-api-b.jpg

write file to host demo

read and write file from host demo

About

A simple Docker Compose Demo for Spring Cloud Project .

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published