File tree Expand file tree Collapse file tree 5 files changed +46
-12
lines changed
identity-service/src/main
java/com/blubin/identityservice/controller
user-service/src/main/resources Expand file tree Collapse file tree 5 files changed +46
-12
lines changed Original file line number Diff line number Diff line change @@ -46,31 +46,40 @@ services:
46
46
networks :
47
47
- spring-cloud-network
48
48
49
- identity-service :
50
- build : ./identity-service
51
- container_name : identity-service
49
+ protobuf :
50
+ build : ./protobuf
51
+ container_name : protobuf
52
+ restart : always
53
+ networks :
54
+ - spring-cloud-network
55
+
56
+ user-service :
57
+ build : ./user-service
58
+ container_name : user-service
52
59
ports :
53
- - " 18081:8081"
60
+ - " 18080:8080" # HTTP
61
+ - " 19090:19090" # gRPC
54
62
restart : always
55
63
environment :
56
64
- SPRING_DATASOURCE_URL
57
- - GOOGLE_CLIENT_ID
58
- - GOOGLE_CLIENT_SECRET
59
65
depends_on :
60
66
- postgres
61
67
networks :
62
68
- spring-cloud-network
63
69
64
- user -service :
65
- build : ./user -service
66
- container_name : user -service
70
+ identity -service :
71
+ build : ./identity -service
72
+ container_name : identity -service
67
73
ports :
68
- - " 18080:8080 "
74
+ - " 18081:8081 "
69
75
restart : always
70
76
environment :
71
77
- SPRING_DATASOURCE_URL
78
+ - GOOGLE_CLIENT_ID
79
+ - GOOGLE_CLIENT_SECRET
72
80
depends_on :
73
81
- postgres
82
+ - user-service
74
83
networks :
75
84
- spring-cloud-network
76
85
Original file line number Diff line number Diff line change
1
+ package com .blubin .identityservice .controller ;
2
+
3
+ import org .springframework .http .ResponseEntity ;
4
+ import org .springframework .web .bind .annotation .GetMapping ;
5
+ import org .springframework .web .bind .annotation .RequestMapping ;
6
+ import org .springframework .web .bind .annotation .RestController ;
7
+
8
+ @ RestController
9
+ @ RequestMapping ("/" )
10
+ public class HealthCheckController {
11
+ @ GetMapping
12
+ public ResponseEntity <String > healthCheck () {
13
+ return ResponseEntity .ok ("Identity Service is running" );
14
+ }
15
+ }
Original file line number Diff line number Diff line change 4
4
grpc :
5
5
client :
6
6
user-service :
7
- address : " static://localhost:19090"
7
+ # address: "static://localhost:19090"
8
+ address : " static://user-service:19090" # for docker
9
+ # address: "static://0.0.0.0:19090" # for docker
10
+ # address: dns:///user-service:19090
8
11
negotiationType : plaintext
9
12
10
13
spring :
Original file line number Diff line number Diff line change
1
+ FROM alpine:latest
2
+ LABEL authors="binh"
3
+
4
+ WORKDIR /app
5
+ COPY . .
6
+ RUN apk add --no-cache protobuf
Original file line number Diff line number Diff line change @@ -4,10 +4,11 @@ server:
4
4
grpc :
5
5
server :
6
6
port : 19090
7
+ address : 0.0.0.0
7
8
8
9
spring :
9
10
application :
10
- name : user_service
11
+ name : user-service
11
12
datasource :
12
13
url : jdbc:postgresql://localhost:5432/ecommerce
13
14
username : postgres
You can’t perform that action at this time.
0 commit comments