Skip to content

Commit ea50930

Browse files
sthelemanndargmuesli
authored andcommitted
feat(zammad): use x-shared section
An x-shared section was added to the stack.yml file, similar as in the original docker-compose yaml file to reuse environment settings etc. in several Zammad services.
1 parent 2fc6d2b commit ea50930

File tree

2 files changed

+221
-4
lines changed

2 files changed

+221
-4
lines changed

README.md

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ This project is deployed in accordance to the [DargStack template](https://githu
1010

1111
1. [secrets](#secrets)
1212

13-
2. [services](#services)
13+
2. [x-shared](#x-shared)
1414

15-
3. [volumes](#volumes)
15+
3. [services](#services)
16+
17+
4. [volumes](#volumes)
1618

1719

1820
## secrets
@@ -167,6 +169,14 @@ This project is deployed in accordance to the [DargStack template](https://githu
167169
The captcha provider's application key.
168170

169171

172+
## x-shared
173+
174+
175+
- ### `zammad-service`
176+
177+
shared environment, image, volumes
178+
179+
170180
## services
171181

172182

@@ -274,6 +284,42 @@ This project is deployed in accordance to the [DargStack template](https://githu
274284

275285
You can access the main project's frontend at [app.localhost](https://app.localhost/).
276286

287+
- ### `zammad-backup`
288+
289+
Zammad backup.
290+
291+
- ### `zammad-elasticsearch`
292+
293+
Zammad Elastisearch.
294+
295+
- ### `zammad-init`
296+
297+
Zammad initialization.
298+
299+
- ### `zammad-memcached`
300+
301+
Zammad memcached.
302+
303+
- ### `zammad-nginx`
304+
305+
You can access the Zammad frontend at [zammad.localhost](https://zammad.localhost/).
306+
307+
- ### `zammad-railsserver`
308+
309+
Zammad railsserver.
310+
311+
- ### `zammad-redis`
312+
313+
Zammad redis.
314+
315+
- ### `zammad-scheduler`
316+
317+
Zammad scheduler.
318+
319+
- ### `zammad-websocket`
320+
321+
Zammad websocket.
322+
277323

278324
## volumes
279325

@@ -330,4 +376,20 @@ This project is deployed in accordance to the [DargStack template](https://githu
330376

331377
The frontend's data.
332378

379+
- ### `zammad-backup`
380+
381+
Zammad's backup data
382+
383+
- ### `zammad-elasticsearch-data`
384+
385+
Zammad's elastisearch data
386+
387+
- ### `zammad-redis-data`
388+
389+
Zammad's redis data
390+
391+
- ### `zammad-storage`
392+
393+
Zammad's storage data
394+
333395

src/development/stack.yml

Lines changed: 157 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# Vibetype
44
# https://github.com/maevsi/vibetype/
55
---
6+
7+
#version: "3.7"
8+
69
secrets:
710
grafana_admin_email:
811
# The observation dashboard's admin email.
@@ -106,6 +109,69 @@ secrets:
106109
vibetype_turnstile-key:
107110
# The captcha provider's application key.
108111
file: ./secrets/vibetype/turnstile-key.secret
112+
113+
x-shared:
114+
zammad-service: &zammad-service
115+
# shared environment, image, volumes
116+
environment: &zammad-environment
117+
MEMCACHE_SERVERS: ${MEMCACHE_SERVERS:-zammad-memcached:11211}
118+
POSTGRESQL_DB: zammad
119+
POSTGRESQL_HOST: postgres
120+
POSTGRESQL_USER: zammad
121+
POSTGRESQL_PASS: zammad
122+
POSTGRESQL_PORT: 5432
123+
POSTGRESQL_OPTIONS: ${POSTGRESQL_OPTIONS:-?pool=50}
124+
POSTGRESQL_DB_CREATE: "false"
125+
REDIS_URL: ${REDIS_URL:-redis://zammad-redis:6379}
126+
S3_URL:
127+
# Backup settings
128+
BACKUP_DIR: "${BACKUP_DIR:-/var/tmp/zammad}"
129+
BACKUP_TIME: "${BACKUP_TIME:-03:00}"
130+
HOLD_DAYS: "${HOLD_DAYS:-10}"
131+
TZ: "${TZ:-Europe/Berlin}"
132+
# Allow passing in these variables via .env:
133+
AUTOWIZARD_JSON:
134+
AUTOWIZARD_RELATIVE_PATH:
135+
ELASTICSEARCH_ENABLED:
136+
ELASTICSEARCH_SCHEMA:
137+
ELASTICSEARCH_HOST:
138+
ELASTICSEARCH_PORT:
139+
ELASTICSEARCH_USER: ${ELASTICSEARCH_USER:-elastic}
140+
ELASTICSEARCH_PASS: ${ELASTICSEARCH_PASS:-zammad}
141+
ELASTICSEARCH_NAMESPACE:
142+
ELASTICSEARCH_REINDEX:
143+
NGINX_PORT: 8080
144+
NGINX_CLIENT_MAX_BODY_SIZE:
145+
NGINX_SERVER_NAME: zammad.${STACK_DOMAIN}
146+
NGINX_SERVER_SCHEME: https
147+
RAILS_TRUSTED_PROXIES:
148+
ZAMMAD_HTTP_TYPE:
149+
ZAMMAD_FQDN:
150+
ZAMMAD_WEB_CONCURRENCY:
151+
ZAMMAD_PROCESS_SESSIONS_JOBS_WORKERS:
152+
ZAMMAD_PROCESS_SCHEDULED_JOBS_WORKERS:
153+
ZAMMAD_PROCESS_DELAYED_JOBS_WORKERS:
154+
ZAMMAD_RAILSSERVER_HOST: zammad-railsserver
155+
ZAMMAD_WEBSOCKET_HOST: zammad-websocket
156+
# ZAMMAD_SESSION_JOBS_CONCURRENT is deprecated, please use ZAMMAD_PROCESS_SESSIONS_JOBS_WORKERS instead.
157+
ZAMMAD_SESSION_JOBS_CONCURRENT:
158+
# Variables used by ngingx-proxy container for reverse proxy creations
159+
# for docs refer to https://github.com/nginx-proxy/nginx-proxy
160+
VIRTUAL_HOST:
161+
VIRTUAL_PORT:
162+
# Variables used by acme-companion for retrieval of LetsEncrypt certificate
163+
# for docs refer to https://github.com/nginx-proxy/acme-companion
164+
LETSENCRYPT_HOST:
165+
LETSENCRYPT_EMAIL:
166+
167+
image: ${IMAGE_REPO:-ghcr.io/zammad/zammad}:${VERSION:-6.5.0-89}
168+
volumes:
169+
- zammad-storage:/opt/zammad/storage
170+
depends_on:
171+
- zammad-memcached
172+
- postgresql
173+
- zammad-redis
174+
109175
services:
110176
adminer:
111177
# You can access the database's frontend at [adminer.app.localhost](https://adminer.app.localhost/).
@@ -405,6 +471,7 @@ services:
405471
volumes:
406472
- reccoom_postgres_data:/var/lib/postgresql/
407473
zammad-elasticsearch:
474+
# You cannot access the search engine via a web interface.
408475
image: bitnami/elasticsearch:${ELASTICSEARCH_VERSION:-8.18.0}
409476
restart: always
410477
volumes:
@@ -413,6 +480,7 @@ services:
413480
- discovery.type=single-node
414481

415482
zammad-init:
483+
# You cannot access the helpdesk initialization container via a web interface.
416484
image: zammad/zammad-docker-compose:latest
417485
restart: on-failure
418486
depends_on:
@@ -440,6 +508,7 @@ services:
440508
command: ["zammad-init"]
441509

442510
zammad-railsserver:
511+
# You can access the helpdesk's API at [zammad.app.localhost/api](https://zammad.app.localhost/api/).
443512
image: zammad/zammad-docker-compose:latest
444513
restart: always
445514
depends_on:
@@ -474,6 +543,7 @@ services:
474543
command: ["zammad-railsserver"]
475544

476545
zammad-scheduler:
546+
# You cannot access the helpdesk job scheduler via a web interface.
477547
image: zammad/zammad-docker-compose:latest
478548
restart: always
479549
depends_on:
@@ -497,10 +567,12 @@ services:
497567
command: ["zammad-scheduler"]
498568

499569
zammad-redis:
570+
# You cannot access the helpdesk's redis instance via a web interface.
500571
image: redis:7-alpine
501572
restart: always
502573

503574
zammad-websocket:
575+
# You cannot access the helpdesk's websocket server via a web interface.
504576
image: zammad/zammad-docker-compose:latest
505577
restart: always
506578
depends_on:
@@ -533,6 +605,7 @@ services:
533605
- traefik.http.services.zammad-websocket.loadbalancer.server.port=6042
534606

535607
zammad-nginx:
608+
# You can access the helpdesk's frontend at [zammad.app.localhost](https://zammad.app.localhost/).
536609
image: zammad/zammad-docker-compose:latest
537610
restart: always
538611
depends_on:
@@ -728,6 +801,78 @@ services:
728801
- ../../../vibetype/:/srv/app/ #DARGSTACK-REMOVE
729802
- vibetype_data:/srv/app/node_modules #DARGSTACK-REMOVE
730803
- ./configurations/postgraphile/jwtRS256.key.pub:/run/environment-variables/NUXT_PUBLIC_VIO_AUTH_JWT_PUBLIC_KEY:ro
804+
zammad-backup:
805+
# Zammad backup.
806+
<<: *zammad-service
807+
command: ["zammad-backup"]
808+
volumes:
809+
- zammad-backup:/var/tmp/zammad
810+
- zammad-storage:/opt/zammad/storage:ro
811+
user: 0:0
812+
813+
zammad-elasticsearch:
814+
# Zammad Elastisearch.
815+
image: bitnami/elasticsearch:${ELASTICSEARCH_VERSION:-8.18.0}
816+
volumes:
817+
- zammad-elasticsearch-data:/bitnami/elasticsearch/data
818+
environment:
819+
# Enable authorization without HTTPS. For external access with
820+
# SSL termination, use solutions like nginx-proxy-manager.
821+
ELASTICSEARCH_ENABLE_SECURITY: 'true'
822+
ELASTICSEARCH_SKIP_TRANSPORT_TLS: 'true'
823+
ELASTICSEARCH_ENABLE_REST_TLS: 'false'
824+
# ELASTICSEARCH_USER is hardcoded to 'elastic' in the container.
825+
ELASTICSEARCH_PASSWORD: ${ELASTICSEARCH_PASS:-zammad}
826+
827+
zammad-init:
828+
# Zammad initialization.
829+
<<: *zammad-service
830+
command: ["zammad-init"]
831+
depends_on:
832+
- postgresql
833+
user: 0:0
834+
835+
zammad-memcached:
836+
# Zammad memcached.
837+
command: memcached -m 256M
838+
image: memcached:${MEMCACHE_VERSION:-1.6.38-alpine}
839+
840+
zammad-nginx:
841+
# You can access the Zammad frontend at [zammad.localhost](https://zammad.localhost/).
842+
<<: *zammad-service
843+
deploy:
844+
labels:
845+
- traefik.enable=true
846+
- traefik.http.routers.zammad.entryPoints=web
847+
- traefik.http.routers.zammad.middlewares=redirectscheme #DARGSTACK-REMOVE
848+
- traefik.http.routers.zammad.rule=Host(`zammad.${STACK_DOMAIN}`)
849+
- traefik.http.routers.zammad_secure.entryPoints=web-secure
850+
- traefik.http.routers.zammad_secure.rule=Host(`zammad.${STACK_DOMAIN}`)
851+
- traefik.http.routers.zammad_secure.tls.options=mintls13@file #DARGSTACK-REMOVE
852+
- traefik.http.services.zammad.loadbalancer.server.port=8080
853+
command: ["zammad-nginx"]
854+
855+
zammad-railsserver:
856+
# Zammad railsserver.
857+
<<: *zammad-service
858+
command: ["zammad-railsserver"]
859+
860+
zammad-redis:
861+
# Zammad redis.
862+
image: redis:${REDIS_VERSION:-7.4.3-alpine}
863+
volumes:
864+
- zammad-redis-data:/data
865+
866+
zammad-scheduler:
867+
# Zammad scheduler.
868+
<<: *zammad-service
869+
command: ["zammad-scheduler"]
870+
871+
zammad-websocket:
872+
# Zammad websocket.
873+
<<: *zammad-service
874+
command: ["zammad-websocket"]
875+
731876
version: "3.7"
732877
volumes:
733878
debezium_kafka_configuration:
@@ -766,5 +911,15 @@ volumes:
766911
vibetype_data:
767912
# The frontend's data.
768913
{}
769-
zammad_elasticsearch_data: {}
770-
zammad_storage: {}
914+
zammad-elasticsearch-data:
915+
# Zammad's elastisearch data
916+
{}
917+
zammad-redis-data:
918+
# Zammad's redis data
919+
{}
920+
zammad-backup:
921+
# Zammad's backup data
922+
{}
923+
zammad-storage:
924+
# Zammad's storage data
925+
{}

0 commit comments

Comments
 (0)