Skip to content

Commit 234a28f

Browse files
committed
I used docker image with Google container tools
1 parent aa6e289 commit 234a28f

File tree

2 files changed

+35
-5
lines changed

2 files changed

+35
-5
lines changed

service-registry/README.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@
1111
* Netflix Eureka Server : https://spring.io/guides/gs/service-registration-and-discovery/
1212
* Google Container Tools : https://github.com/GoogleContainerTools/jib
1313

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+
1427
---
1528
## Development
1629
```shell
@@ -23,11 +36,24 @@ Visit : http://localhost:8761/
2336
## Production With Docker
2437
We will create Docker Image using Google Container Tools and run this Docker Image with Docker Compose.
2538

26-
Build docker image:
39+
### Build docker image:
2740
```shell
2841
$ ./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] ------------------------------------------------------------------------
2952
```
30-
Run:
53+
54+
---
55+
56+
### Run:
3157
```shell
3258
$ docker-compose -f src/main/docker/app.yml up -d
3359

@@ -36,7 +62,7 @@ Creating docker_service-registry_1 ... done
3662
Visit : http://localhost:8761/
3763

3864
---
39-
View docker images:
65+
### View docker images:
4066
```shell
4167
$ docker images
4268

@@ -45,12 +71,17 @@ cevheri/service-registry latest 3d6fd7dccfb5 14 minutes ago 291M
4571

4672
```
4773

48-
View docker containers:
74+
### View docker containers:
4975
````shell
5076
$ docker ps
5177

5278
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5379
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
5480
````
5581

82+
### Stop Docker Compose:
83+
```shell
84+
$ docker-compose -f src/main/docker/app.yml down
85+
86+
```
5687

service-registry/src/main/docker/app.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ services:
55
environment:
66
- _JAVA_OPTIONS=-Xmx512m -Xms256m
77
- SPRING_PROFILES_ACTIVE=prod,api-docs
8-
- MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED=true
98
- APP_SLEEP=10
109
ports:
1110
- 8761:8761

0 commit comments

Comments
 (0)