Skip to content

Commit 551fb33

Browse files
committed
changes to the screencast
1 parent 36ceb11 commit 551fb33

14 files changed

Lines changed: 49 additions & 28 deletions

File tree

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ CQRS, REST, Web Sockets, Continuous deploy with Jenkins, and all developed using
2828

2929
* run package-projects.sh
3030
* run docker-orchestrate.sh
31-
* docker-compose -f infra-docker-compose.yml -p todo up (wait until all services be up)
3231
* docker-compose -p todo up
3332

3433
## Continuous deploy using Jenkins Pipeline
@@ -44,9 +43,9 @@ and paste the content of the Jenkinsfile in the Pipeline script box. Have a look
4443
to check how to work with Jenkins pipeline
4544

4645
### Accessing the services
47-
* Authenticate -> curl -X POST -vu todo-app:123456 http://localhost:8017/oauth/token -H "Accept: application/json" -d "password=1234&username=[email protected]&grant_type=password&scope=write&client_secret=123456&client_id=todo-app"
46+
* Authenticate -> ```curl -X POST -vu todo-app:123456 http://localhost:8017/oauth/token -H "Accept: application/json" -d "password=1234&[email protected]&grant_type=password&scope=write&client_secret=123456&client_id=todo-app"```
4847

49-
* Get data using the access_token -> localhost:8018/accounts?access_token={access_token} or curl -H "Authorization: Bearer $TOKEN" "localhost:8018/path"
48+
* Get data using the access_token -> `localhost:8018/accounts?access_token={access_token}` or `curl -H "Authorization: Bearer $TOKEN" "localhost:8018/path"`
5049

5150
### Scaling
5251
NGINX will be configured for browser caching of the static content and Load balance. For that we will need to scale our App Gateway
@@ -104,7 +103,7 @@ curl -d '{"userEmail":"[email protected]", "caption":"post caption", "description":"
104103

105104
```
106105
# running separated container and link to the network infrastructure
107-
docker run -d -p 8026:8026 --network todo_net --add-host eureka:172.19.0.3 todo/admin-server
106+
docker run -d -p 8018:8018 --network todo_net --add-host eureka:172.19.0.5 --add-host config:172.19.0.2 todo/reminder-service
108107
109108
# orchestrate start-up of containers, tailing the logs...
110109
docker-compose -p music up -d container-name && docker logs elk --follow # ^C to break

api-gateway/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,6 @@
101101
<groupId>org.springframework.security</groupId>
102102
<artifactId>spring-security-jwt</artifactId>
103103
</dependency>
104-
<dependency>
105-
<groupId>de.codecentric</groupId>
106-
<artifactId>spring-boot-admin-starter-client</artifactId>
107-
<version>1.5.4</version>
108-
</dependency>
109104

110105
<dependency>
111106
<groupId>com.h2database</groupId>

config-server/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
55

6-
<groupId>org.test</groupId>
6+
<groupId>com.apssouza</groupId>
77
<artifactId>config-server</artifactId>
88
<version>1</version>
99
<packaging>jar</packaging>
@@ -42,7 +42,7 @@
4242
<artifactId>spring-boot-devtools</artifactId>
4343
<optional>true</optional>
4444
</dependency>
45-
45+
4646
</dependencies>
4747

4848
<build>

config-server/src/main/resources/application.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
spring.profiles.active: native
33
spring.application.name: config-server
44
server.port: 8888
5+
eureka.client.serviceUrl.defaultZone : http://eureka:8010/eureka/,http://localhost:8011/eureka/
6+
57
spring:
68
cloud:
79
config:
@@ -12,3 +14,5 @@ spring:
1214
# "native" is used when the native profile is active, for local tests with a classpath repo:
1315
native:
1416
searchLocations: classpath:offline-repository/
17+
18+

docker-compose.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,47 @@ services:
121121
command: ["./wait-for-it.sh","eureka:8010","--timeout=150","--","/usr/local/bin/start.sh"]
122122
external_links:
123123
- elk
124+
125+
zookeeper:
126+
image: wurstmeister/zookeeper
127+
ports:
128+
- 2181:2181
129+
networks:
130+
- net
131+
mem_limit: 925288000
132+
cpu_shares: 100
133+
134+
kafka:
135+
image: wurstmeister/kafka
136+
ports:
137+
- 9092
138+
depends_on:
139+
- zookeeper
140+
environment:
141+
KAFKA_ADVERTISED_HOST_NAME: 172.19.0.1
142+
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
143+
KAFKA_CREATE_TOPICS: "todo-mail:1:1"
144+
volumes:
145+
- /var/run/docker.sock:/var/run/docker.sock
146+
hostname: kafka
147+
container_name: kafka
148+
networks:
149+
- net
150+
mem_limit: 925288000
151+
cpu_shares: 100
124152

153+
proxy:
154+
build: proxy/
155+
ports:
156+
- 8055:80
157+
networks:
158+
- net
159+
depends_on:
160+
- gateway
161+
hostname: proxy
162+
container_name: proxy
163+
command: ["./wait-for-it.sh","gateway:8018","--timeout=50","--","/usr/local/bin/start.sh"]
164+
125165
volumes:
126166
todo_data:
127167
external: true

0 commit comments

Comments
 (0)