Skip to content

Commit

Permalink
Added config value to enable/disable Quartz scheduler. added docker c…
Browse files Browse the repository at this point in the history
…ompose cluster to test API & worker nodes config
  • Loading branch information
maallen committed Aug 15, 2023
1 parent 446350a commit 0cc88dd
Showing 1 changed file with 132 additions and 0 deletions.
132 changes: 132 additions & 0 deletions docker/docker-compose-api-worker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
version: '2.4'
name: mojito
services:
db:
image: mysql:5.7
restart: always
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
interval: 5s
timeout: 30s
retries: 20
environment:
MYSQL_ROOT_PASSWORD: ChangeMe
MYSQL_DATABASE: mojito
MYSQL_USER: mojito
MYSQL_PASSWORD: ChangeMe
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_bin
- --max-connections=1000
worker:
deploy:
mode: replicated
replicas: 1
endpoint_mode: vip
# resources:
# limits:
# cpus: '0.50'
# memory: 500M
# reservations:
# cpus: '0.25'
# memory: 20M
healthcheck:
test: [ "CMD", "curl", "localhost:8080/" ]
interval: 5s
timeout: 10s
retries: 20
depends_on:
db:
condition: service_healthy
api:
condition: service_healthy
build:
dockerfile: docker/Dockerfile-bk8
context: ../
links:
- db
ports:
- "8081:8080"
restart: always
environment:
SPRING_APPLICATION_JSON: '{
"spring.flyway.enabled": "true",
"l10n.flyway.clean" : "false",
"spring.jpa.database-platform" : "org.hibernate.dialect.MySQLDialect",
"spring.jpa.hibernate.ddl-auto" : "none",
"spring.datasource.url" : "jdbc:mysql://db:3306/mojito?characterEncoding=UTF-8&useUnicode=true",
"spring.datasource.username" : "mojito",
"spring.datasource.password" : "ChangeMe",
"spring.datasource.driverClassName" : "com.mysql.cj.jdbc.Driver",
"spring.jpa.defer-datasource-initialization" : "false",
"l10n.org.quartz.scheduler.enabled" : "true",
"l10n.org.quartz.jobStore.useProperties" : "true",
"l10n.org.quartz.scheduler.instanceId" : "AUTO",
"l10n.org.quartz.jobStore.isClustered" : "true",
"l10n.org.quartz.threadPool.threadCount" : "10",
"l10n.org.quartz.jobStore.class" : "org.quartz.impl.jdbcjobstore.JobStoreTX",
"l10n.org.quartz.jobStore.driverDelegateClass" : "org.quartz.impl.jdbcjobstore.StdJDBCDelegate",
"l10n.org.quartz.jobStore.dataSource" : "myDS",
"l10n.org.quartz.dataSource.myDS.provider" : "hikaricp",
"l10n.org.quartz.dataSource.myDS.driver" : "com.mysql.jdbc.Driver",
"l10n.org.quartz.dataSource.myDS.URL" : "jdbc:mysql://db:3306/mojito?characterEncoding=UTF-8&useUnicode=true",
"l10n.org.quartz.dataSource.myDS.user" : "mojito",
"l10n.org.quartz.dataSource.myDS.password" : "ChangeMe",
"l10n.org.quartz.dataSource.myDS.maxConnections" : "12",
"l10n.org.quartz.dataSource.myDS.validationQuery" : "select 1"
}'
api:
deploy:
mode: replicated
replicas: 1
endpoint_mode: vip
# resources:
# limits:
# cpus: '0.50'
# memory: 500M
# reservations:
# cpus: '0.25'
# memory: 20M
healthcheck:
test: [ "CMD", "curl", "localhost:8080/" ]
interval: 5s
timeout: 10s
retries: 20
depends_on:
db:
condition: service_healthy
build:
dockerfile: docker/Dockerfile-bk8
context: ../
links:
- db
ports:
- "8080:8080"
restart: always
environment:
SPRING_APPLICATION_JSON: '{
"spring.flyway.enabled": "true",
"l10n.flyway.clean" : "false",
"spring.jpa.database-platform" : "org.hibernate.dialect.MySQLDialect",
"spring.jpa.hibernate.ddl-auto" : "none",
"spring.datasource.url" : "jdbc:mysql://db:3306/mojito?characterEncoding=UTF-8&useUnicode=true",
"spring.datasource.username" : "mojito",
"spring.datasource.password" : "ChangeMe",
"spring.datasource.driverClassName" : "com.mysql.cj.jdbc.Driver",
"spring.jpa.defer-datasource-initialization" : "false",
"l10n.org.quartz.scheduler.enabled" : "false",
"l10n.org.quartz.jobStore.useProperties" : "true",
"l10n.org.quartz.scheduler.instanceId" : "AUTO",
"l10n.org.quartz.jobStore.isClustered" : "true",
"l10n.org.quartz.threadPool.threadCount" : "10",
"l10n.org.quartz.jobStore.class" : "org.quartz.impl.jdbcjobstore.JobStoreTX",
"l10n.org.quartz.jobStore.driverDelegateClass" : "org.quartz.impl.jdbcjobstore.StdJDBCDelegate",
"l10n.org.quartz.jobStore.dataSource" : "myDS",
"l10n.org.quartz.dataSource.myDS.provider" : "hikaricp",
"l10n.org.quartz.dataSource.myDS.driver" : "com.mysql.jdbc.Driver",
"l10n.org.quartz.dataSource.myDS.URL" : "jdbc:mysql://db:3306/mojito?characterEncoding=UTF-8&useUnicode=true",
"l10n.org.quartz.dataSource.myDS.user" : "mojito",
"l10n.org.quartz.dataSource.myDS.password" : "ChangeMe",
"l10n.org.quartz.dataSource.myDS.maxConnections" : "12",
"l10n.org.quartz.dataSource.myDS.validationQuery" : "select 1"
}'

0 comments on commit 0cc88dd

Please sign in to comment.