You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -31,11 +33,55 @@ The application consists of 7 different services
31
33
*[api-gateway](api-gateway/README.md) - API gateway that proxies all the micro-services
32
34
*[web-portal](web-portal/README.md) - Single Page Application that provides the UI
33
35
34
-
Please refer to the individual readme files on instructions of how to run the services. For demo, you can run the applications in the same order listed above.
35
-
36
-
Note:
37
-
* If the gradle wrapper doesn't work, then install gradle and run `gradle wrapper` before using `gradlew`.
38
-
* If you need to setup the classpath correctly, then run `./gradlew clean build eclipse` which would setup the `.classpath` accordingly.
36
+
### <aname="run_local_mc"></a>Running on local m/c
37
+
38
+
* You can build all the projects by running the `./build-all-projects.sh` on Mac/Linux systems and then going to each individual folder and running the jars using the `java -jar build/libs/sam<application_name>.jar` command.
39
+
* Please refer to the individual readme files on instructions of how to run the services. For demo, you can run the applications in the same order listed above.
40
+
41
+
### <aname="run_docker"></a>Running using docker (**NOTE: NOT WORKING with latest docker 1.8x since the gradle docker task is NOT compatible; also bug in Spring Boot 1.2.x**)
42
+
43
+
*[Docker](https://www.docker.com) is an open platform for building, shipping and running distributed applications. Follow steps on the site to install docker based on your operating system.
44
+
* Currently there is a **[bug in Spring Boot 1.2.x](https://github.com/spring-projects/spring-boot/commit/8168e8a3275f17646c5c2bf628d2f3417369c583)** that affects the way how JPA starts in an app launched with executable jar. Hence while the docker containers are good to go, we will need to change the application once Spring boot 1.3 is released so that we can run this on docker.
45
+
* Once docker is setup, we would reset the VM so as to start fresh. The examples were developed on Mac so follow these step; they would be fairly similar on Windows.
46
+
* Once you open the docker program through terminal, follow these steps
47
+
* Reset the VM => `boot2docker delete`
48
+
* Start the VM giving it around 8 GB of RAM => `boot2docker init -m 8192`
49
+
* Check whether the initialization parameters were successful => `boot2docker info`
50
+
* Start the VM => `boot2docker up`
51
+
* To connect the Docker client to the Docker daemon => `$(boot2docker shellinit)`
52
+
* If you have not added your TLS certs to boot2docker; you would need to change docker to run the API on HTTP; while boot2docker 1.3 comes with TLS enabled. Hence you need to run the following command `$(docker run sequenceiq/socat)` at the docker prompt so that this image maps the api to HTTP port. You can check that it is working correctly(returns OK) using the command `curl http://192.168.59.103:2375/_ping` or connect the `http://192.168.59.103:2375/_ping` URL in the browser.
53
+
* Run the mysql container using `docker run -d -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=auth --name auth-db -p 3306:3306 mysql`
54
+
* On the mac command prompt, navigate to the root folder of the application (spring-boot-microservices) and run the `./docker-image-all-projects.sh` command. This should build all the images and publish them to docker.
55
+
* Run the individual images as below; note that the auth-server and api-gateway images fail because of Spring Boot 1.2.x bug.
56
+
* Config Server
57
+
* docker run -d --name config-server -p 8888:8888 anilallewar/config-server
58
+
* docker logs -f config-server
59
+
* Eureka Server
60
+
* docker run -d --name registry-server -p 8761:8761 anilallewar/webservice-registry
61
+
* docker logs -f registry-server
62
+
* OAuth Server
63
+
* docker run -d --name auth-server -p 8899:8899 anilallewar/auth-server
64
+
* docker logs -f auth-server
65
+
* User Webservice
66
+
* docker run -d --name user-webservice anilallewar/user-webservice
67
+
* docker logs -f user-web service
68
+
* Task Webservice
69
+
* docker run -d --name task-webservice anilallewar/task-webservice
70
+
* docker logs -f task-webservice
71
+
* Comments Webservice
72
+
* docker run -d --name comments-webservice anilallewar/comments-webservice
73
+
* docker logs -f comments-webservice
74
+
* Web Portal
75
+
* docker run -d --name web-portal anilallewar/web-portal
76
+
* docker logs -f web-portal
77
+
* Zuul API Gateway
78
+
* docker run -d --name api-gateway -p 8080:8080 anilallewar/api-gateway
79
+
* docker logs -f api-gateway
80
+
* We also have a [docker-compose](https://docs.docker.com/compose/) file that can be used to start all the containers together using `docker-compose up -d`. However this doesn't work in our case since our containers need to be started in order e.g. config-server before everything, webservice-registry before rest of Eureka clients. Docker compose starts all containers together and this fails because containers like auth-server, web-portal start before their dependent containers have started. Please see [here](https://github.com/docker/compose/issues/374) for more details.
81
+
82
+
* Note:
83
+
* If the gradle wrapper doesn't work, then install gradle and run `gradle wrapper` before using `gradlew`.
84
+
* If you need to setup the classpath correctly, then run `./gradlew clean build eclipse` which would setup the `.classpath` accordingly.
0 commit comments