Skip to content

Commit 2b977f4

Browse files
committed
added docker-compose files.
1 parent dc4f8be commit 2b977f4

File tree

5 files changed

+73
-9
lines changed

5 files changed

+73
-9
lines changed

src/main/docker/app.yml

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,63 @@ services:
88
- SPRING_PROFILES_ACTIVE=prod,api-docs
99
- MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED=true
1010
- SPRING_DATASOURCE_URL=jdbc:postgresql://blog-postgresql:5432/blog
11+
- SPRING_DATASOURCE_USERNAME=blog
12+
- SPRING_DATASOURCE_PASSWORD=blog
1113
- SPRING_LIQUIBASE_URL=jdbc:postgresql://blog-postgresql:5432/blog
14+
- EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://admin:[email protected]:8761/eureka/
1215
- JHIPSTER_SLEEP=30 # gives time for other services to boot before the application
1316
# If you want to expose these ports outside your dev PC,
1417
# remove the "127.0.0.1:" prefix
1518
ports:
16-
- 127.0.0.1:8080:8080
19+
- "8080:8080"
20+
depends_on:
21+
- blog-postgresql
22+
- eureka-server
23+
# - zipkin
24+
- jhipster-control-center
1725
blog-postgresql:
1826
image: postgres:14.2
1927
# volumes:
2028
# - ~/volumes/jhipster/blog/postgresql/:/var/lib/postgresql/data/
2129
environment:
30+
- POSTGRES_DB=blog
2231
- POSTGRES_USER=blog
23-
- POSTGRES_PASSWORD=
32+
- POSTGRES_PASSWORD=blog
2433
- POSTGRES_HOST_AUTH_METHOD=trust
25-
# If you want to expose these ports outside your dev PC,
26-
# remove the "127.0.0.1:" prefix
2734
ports:
28-
- 127.0.0.1:5432:5432
35+
- "5432:5432"
36+
eureka-server:
37+
image: taskbeez/eureka-server:master
38+
hostname: eureka-server
39+
ports:
40+
- "8761:8761"
41+
# config-server:
42+
# image: hyness/spring-cloud-config-server:latest
43+
# ports:
44+
# - "8888:8888"
45+
# links:
46+
# - "eureka-server"
47+
# volumes:
48+
# - ./config-server/config:/app/config
49+
# zipkin:
50+
# image: openzipkin/zipkin:2.23
51+
# ports:
52+
# - "9411:9411"
53+
jhipster-control-center:
54+
image: 'jhipster/jhipster-control-center:v0.5.0'
55+
command:
56+
- /bin/sh
57+
- -c
58+
# Patch /etc/hosts to support resolving host.docker.internal to the internal IP address used by the host in all OSes
59+
- echo "`ip route | grep default | cut -d ' ' -f3` host.docker.internal" | tee -a /etc/hosts > /dev/null && java -jar /jhipster-control-center.jar
60+
environment:
61+
- _JAVA_OPTIONS=-Xmx512m -Xms256m
62+
- SPRING_PROFILES_ACTIVE=prod,api-docs,no
63+
- JHIPSTER_SLEEP=30 # gives time for other services to boot before the application
64+
- SPRING_SECURITY_USER_PASSWORD=admin
65+
# The token should have the same value than the one declared in you Spring configuration under the jhipster.security.authentication.jwt.base64-secret configuration's entry
66+
- JHIPSTER_SECURITY_AUTHENTICATION_JWT_BASE64_SECRET=NzI1ZDlhYWU4MjNiZDBlZjVhMTZiNjliMmRlNDA3N2QyM2MyYmIxYTE2ZWFmNzJmMzExMWZjMWNiMDhjZGY5NjQxNzUyZTg3Yjc0NmZiMTIxZGI5NTA2MzQ4MzlkNTE5Y2UzMDM2MWVkMTRkOWUyZTRlNTllNzJkMzEzOWRiNDY=
67+
- SPRING_CLOUD_DISCOVERY_CLIENT_SIMPLE_INSTANCES_BLOG_0_URI=http://host.docker.internal:8080
68+
- LOGGING_FILE_NAME=/tmp/jhipster-control-center.log
69+
ports:
70+
- "7419:7419"

src/main/docker/eureka.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: '3.8'
2+
services:
3+
eureka-server:
4+
image: taskbeez/eureka-server:master
5+
hostname: eureka-server
6+
ports:
7+
- "8761:8761"
8+
config-server:
9+
image: hyness/spring-cloud-config-server:latest
10+
ports:
11+
- "8888:8888"
12+
links:
13+
- "eureka-server"
14+
volumes:
15+
- ./config-server/config:/app/config

src/main/docker/jhipster-control-center.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,5 @@ services:
4646
- JHIPSTER_SECURITY_AUTHENTICATION_JWT_BASE64_SECRET=NzI1ZDlhYWU4MjNiZDBlZjVhMTZiNjliMmRlNDA3N2QyM2MyYmIxYTE2ZWFmNzJmMzExMWZjMWNiMDhjZGY5NjQxNzUyZTg3Yjc0NmZiMTIxZGI5NTA2MzQ4MzlkNTE5Y2UzMDM2MWVkMTRkOWUyZTRlNTllNzJkMzEzOWRiNDY=
4747
- SPRING_CLOUD_DISCOVERY_CLIENT_SIMPLE_INSTANCES_BLOG_0_URI=http://host.docker.internal:8080
4848
- LOGGING_FILE_NAME=/tmp/jhipster-control-center.log
49-
# If you want to expose these ports outside your dev PC,
50-
# remove the "127.0.0.1:" prefix
5149
ports:
52-
- 127.0.0.1:7419:7419
50+
- "7419:7419"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This configuration is intended for development purpose, it's **your** responsibility to harden it for production
2+
version: '3.8'
3+
services:
4+
config-server:
5+
image: spring-cloud-netflix-example/config-server
6+
links:
7+
- "eureka-server"
8+
volumes:
9+
- ./config-server/config:/app/config

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ spring:
6161
probability: 1 # report 100% of traces
6262
zipkin: # Use the "zipkin" Maven profile to have the Spring Cloud Zipkin dependencies
6363
base-url: http://localhost:9411
64-
enabled: false
64+
enabled: true
6565
locator:
6666
discovery:
6767
enabled: true

0 commit comments

Comments
 (0)