kbastani / spring-cloud-microservice-example

An example project that demonstrates an end-to-end cloud native application using Spring Cloud for building a practical microservices architecture.
http://www.kennybastani.com/2015/07/spring-cloud-docker-microservices.html
GNU General Public License v3.0
176 stars 135 forks source link

run example locally without docker #31

Closed huiwang closed 8 years ago

huiwang commented 8 years ago

Hello All,

I have one question regarding the bootstrap file, for example the one in movie-microservice.

In that file, we point to the config server with "uri: http://configserver:8888". However, the hostname configserver makes sense only services are started with docker-compose if I understood it well.

Therefore, when I start the service locally in my ide for example without docker, I can't resolve the domain name.

I think the profile feature can help us to resolve this problem but all profile related resources I found is about the configserver but not on the bootstrap file.

Can someone help me out please ?

Thanks, Hui

huiwang commented 8 years ago

I think i get the answer

spring:
  application:
    name: movie
  cloud:
    config:
      uri: http://configserver:8888
encrypt:
  failOnError: false

goes to

spring:
  application:
    name: movie
  cloud:
    config:
      uri: http://configserver:8888
encrypt:
  failOnError: false

---
spring:
  profiles: development
  cloud:
    config:
      uri: http://localhost:8888

Then start the service with -Dspring.profiles.active=development.