@@ -4,67 +4,67 @@ version: '3.9'
44services :
55 # App backend service
66 # app:
7- # This service depends on postgres db and keycloak auth. Start that first.
8- # depends_on:
9- # db:
10- # condition: service_healthy
11- # keycloak:
12- # condition: service_started
13- # image: spring-boot-keycloak-docker-postgres:latest
14- # build:
15- # context: ./
16- # dockerfile: "Dockerfile"
17- # Give the container the name web-app. You can change to something else.
18- # container_name: web-app
19- # Forward the exposed port 8080 on the container to port 8080 on the host machine
20- # ports:
21- # - "0.0.0.0:8088:8080/tcp"
22- # - target: 8080
23- # host_ip: 0.0.0.0
24- # published: 8088
25- # protocol: tcp
26- # mode: host
27- # ports:
28- # - "8080:8080"
29- # networks:
30- # - backend
31- # entrypoint: [ "java", "-Xms512m", "-Xmx1g", "-jar" ]
7+ # This service depends on postgres db and keycloak auth. Start that first.
8+ # depends_on:
9+ # db:
10+ # condition: service_healthy
11+ # keycloak:
12+ # condition: service_started
13+ # image: spring-boot-keycloak-docker-postgres:latest
14+ # build:
15+ # context: ./
16+ # dockerfile: "Dockerfile"
17+ # Give the container the name web-app. You can change to something else.
18+ # container_name: web-app
19+ # Forward the exposed port 8080 on the container to port 8080 on the host machine
20+ # ports:
21+ # - "0.0.0.0:8088:8080/tcp"
22+ # - target: 8080
23+ # host_ip: 0.0.0.0
24+ # published: 8088
25+ # protocol: tcp
26+ # mode: host
27+ # ports:
28+ # - "8080:8080"
29+ # networks:
30+ # - backend
31+ # entrypoint: [ "java", "-Xms512m", "-Xmx1g", "-jar" ]
3232 # Database Service (Postgres)
3333 # db:
34- # Give the container the name postgres-db. You can change to something else.
35- # container_name: postgres-db
36- # Use the Docker Image postgres. This will pull the 14 version.
37- # image: postgres:14-alpine
38- # healthcheck:
39- # test: [ "CMD", "pg_isready", "-q", "-d", "postgres", "-U" ]
40- # timeout: 45s
41- # interval: 10s
42- # retries: 10
43- # restart: always
44- # Set a volume some that database is not lost after shutting down the container.
45- # I used the name postgres-data, but you can change it to something else.
46- # volumes:
47- # - postgres_data_keycloak:/var/lib/postgresql/data
48- # networks:
49- # - backend
50- # network_mode: host
51- # Maps port 5432 (localhost) to port 5432 on the container. You can change the ports to fix your needs.
52- # ports:
53- # - "5432:5432"
54- # Set up the username, password, and database name. You can change these values.
55- # environment:
56- # POSTGRES_USER: postgres
57- # POSTGRES_PASSWORD: postgres
58- # POSTGRES_DB: automobiles
59- # PGDATA: /var/lib/postgresql/data/pgdata
34+ # Give the container the name postgres-db. You can change to something else.
35+ # container_name: postgres-db
36+ # Use the Docker Image postgres. This will pull the 14 version.
37+ # image: postgres:14-alpine
38+ # healthcheck:
39+ # test: [ "CMD", "pg_isready", "-q", "-d", "postgres", "-U" ]
40+ # timeout: 45s
41+ # interval: 10s
42+ # retries: 10
43+ # restart: always
44+ # Set a volume some that database is not lost after shutting down the container.
45+ # I used the name postgres-data, but you can change it to something else.
46+ # volumes:
47+ # - postgres_data_keycloak:/var/lib/postgresql/data
48+ # networks:
49+ # - backend
50+ # network_mode: host
51+ # Maps port 5432 (localhost) to port 5432 on the container. You can change the ports to fix your needs.
52+ # ports:
53+ # - "5432:5432"
54+ # Set up the username, password, and database name. You can change these values.
55+ # environment:
56+ # POSTGRES_USER: postgres
57+ # POSTGRES_PASSWORD: postgres
58+ # POSTGRES_DB: automobiles
59+ # PGDATA: /var/lib/postgresql/data/pgdata
6060 # Auth service
6161 keycloak :
6262 container_name : keycloak-auth
6363 image : quay.io/keycloak/keycloak:22.0.1
64- # build:
65- # context: .
66- # args:
67- # KEYCLOAK_VERSION: 22.0.1
64+ # build:
65+ # context: .
66+ # args:
67+ # KEYCLOAK_VERSION: 22.0.1
6868 command :
6969 - " start-dev"
7070 ports :
@@ -81,7 +81,7 @@ services:
8181 KC_DB_PASSWORD : password
8282 KC_HEALTH_ENABLED : true
8383 depends_on :
84- - keycloak-db
84+ - keycloak-db
8585 # volumes:
8686 # - /home/keycloak/automobile-realm.json:/opt/keycloak/data/import/automobile-realm.json
8787 # Database Service (Postgres) for Keycloak
@@ -96,22 +96,58 @@ services:
9696 POSTGRES_DB : keycloak
9797 POSTGRES_USER : keycloak
9898 POSTGRES_PASSWORD : password
99- networks :
100- - keycloak
99+ networks : [ keycloak ]
101100 healthcheck :
102101 test : [ "CMD", "pg_isready", "-q", "-d", "postgres", "-U" ]
103102 timeout : 45s
104103 interval : 10s
105104 retries : 10
106105
106+ activemq :
107+ image : webcenter/activemq:latest
108+ ports :
109+ # mqtt
110+ - " 1883:1883"
111+ # amqp
112+ - " 5672:5672"
113+ # ui
114+ - " 8161:8161"
115+ # stomp
116+ - " 61613:61613"
117+ # ws
118+ - " 61614:61614"
119+ # jms
120+ - " 61616:61616"
121+ networks : [ activemq ]
122+ volumes : [ "activemq-data:/opt/activemq/conf", "activemq-data:/data/activemq", "activemq-data:/var/log/activemq" ]
123+ environment :
124+ ACTIVEMQ_REMOVE_DEFAULT_ACCOUNT : " true"
125+ ACTIVEMQ_ADMIN_LOGIN : admin
126+ ACTIVEMQ_ADMIN_PASSWORD : password
127+ ACTIVEMQ_WRITE_LOGIN : write
128+ ACTIVEMQ_WRITE_PASSWORD : password
129+ ACTIVEMQ_READ_LOGIN : read
130+ ACTIVEMQ_READ_PASSWORD : password
131+ ACTIVEMQ_JMX_LOGIN : jmx
132+ ACTIVEMQ_JMX_PASSWORD : password
133+
134+ ACTIVEMQ_STATIC_TOPICS : static-topic-1;static-topic-2;autoTopic
135+ ACTIVEMQ_STATIC_QUEUES : static-queue-1;static-queue-2
136+ ACTIVEMQ_ENABLED_SCHEDULER : " true"
137+ ACTIVEMQ_MIN_MEMORY : 512
138+ ACTIVEMQ_MAX_MEMORY : 2048
139+
107140networks :
108- # backend:
141+ # backend:
109142 # name: app
110- # driver: bridge
143+ # driver: bridge
111144 keycloak :
112145 name : keycloak
113146 driver : bridge
147+ activemq : { }
114148
115149volumes :
116150 postgres_data_keycloak :
117151 driver : local
152+ activemq-data :
153+ driver : local
0 commit comments