11
11
* Netflix Eureka Server : https://spring.io/guides/gs/service-registration-and-discovery/
12
12
* Google Container Tools : https://github.com/GoogleContainerTools/jib
13
13
14
+ ## Configuration
15
+ src/main/docker/app.yml
16
+ ``` yaml
17
+ version : ' 3.8'
18
+ services :
19
+ service-registry :
20
+ image : cevheri/service-registry
21
+ environment :
22
+ - _JAVA_OPTIONS=-Xmx512m -Xms256m
23
+ ports :
24
+ - 8761:8761
25
+ ` ` `
26
+
14
27
---
15
28
## Development
16
29
` ` ` shell
@@ -23,11 +36,24 @@ Visit : http://localhost:8761/
23
36
## Production With Docker
24
37
We will create Docker Image using Google Container Tools and run this Docker Image with Docker Compose.
25
38
26
- Build docker image:
39
+ ### Build docker image:
27
40
``` shell
28
41
$ ./mvnw -Pprod verify jib:dockerBuild
42
+
43
+ [INFO] Executing tasks:
44
+ [INFO] [============================== ] 100.0% complete
45
+ [INFO]
46
+ [INFO] ------------------------------------------------------------------------
47
+ [INFO] BUILD SUCCESS
48
+ [INFO] ------------------------------------------------------------------------
49
+ [INFO] Total time: 17.728 s
50
+ [INFO] Finished at: 2021-06-15T21:45:11+03:00
51
+ [INFO] ------------------------------------------------------------------------
29
52
```
30
- Run:
53
+
54
+ ---
55
+
56
+ ### Run:
31
57
``` shell
32
58
$ docker-compose -f src/main/docker/app.yml up -d
33
59
@@ -36,7 +62,7 @@ Creating docker_service-registry_1 ... done
36
62
Visit : http://localhost:8761/
37
63
38
64
---
39
- View docker images:
65
+ ### View docker images:
40
66
``` shell
41
67
$ docker images
42
68
@@ -45,12 +71,17 @@ cevheri/service-registry latest 3d6fd7dccfb5 14 minutes ago 291M
45
71
46
72
```
47
73
48
- View docker containers:
74
+ ### View docker containers:
49
75
```` shell
50
76
$ docker ps
51
77
52
78
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
53
79
fac279d0d208 cevheri/service-registry " bash -c /entrypoint…" 18 seconds ago Up 16 seconds 0.0.0.0:8761-> 8761/tcp, :::8761-> 8761/tcp docker_service-registry_1
54
80
````
55
81
82
+ ### Stop Docker Compose:
83
+ ``` shell
84
+ $ docker-compose -f src/main/docker/app.yml down
85
+
86
+ ```
56
87
0 commit comments