Skip to content
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions src/development/certificates/mkcert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ done

create "root"
create "traefik" \
`# adminer` "adminer.localhost" \
`# grafana` "grafana.localhost" \
`# minio` "minio.localhost" \
`# portainer` "portainer.localhost" \
`# postgraphile` "postgraphile.localhost" \
`# prometheus` "prometheus.localhost" \
`# redpanda` "redpanda.localhost" \
`# traefik` "traefik.localhost" \
`# tusd` "tusd.localhost" \
`# vibetype` "localhost" "www.localhost" "127.0.0.1" "0.0.0.0"
Comment on lines -32 to -42
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to delete the comments

"adminer.localhost" \
"grafana.localhost" \
"minio.localhost" \
"portainer.localhost" \
"postgraphile.localhost" \
"prometheus.localhost" \
"redpanda.localhost" \
"traefik.localhost" \
"tusd.localhost" \
"zammad.localhost" \
"localhost" "www.localhost" "127.0.0.1" "0.0.0.0"

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zammad
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<string>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zammad
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<string>
168 changes: 167 additions & 1 deletion src/development/stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ secrets:
postgres_role_service_vibetype_username:
# The `tusd` database role's password.
file: ./secrets/postgres/role_service_vibetype_username.secret
postgres_role_service_zammad_password:
# The password of the customer service database role.
file: ./secrets/postgres/role_service_zammad_password.secret
postgres_role_service_zammad_username:
# The username of the customer service database role.
file: ./secrets/postgres/role_service_zammad_username.secret
postgres_user:
# The database's default user.
file: ./secrets/postgres/user.secret
Expand Down Expand Up @@ -295,7 +301,7 @@ services:
POSTGRES_DB_FILE: /run/secrets/postgres_db
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
POSTGRES_USER_FILE: /run/secrets/postgres_user
image: postgis/postgis:17-3.5-alpine
image: imresamu/postgis:17-3.5.2-alpine3.21
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be reverted

ports: #DARGSTACK-REMOVE
- 5432:5432 #DARGSTACK-REMOVE
secrets:
Expand Down Expand Up @@ -344,6 +350,162 @@ services:
- postgres_user
volumes:
- ../../../reccoom/:/srv/app/

zammad-elasticsearch:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can elasticsearch be used by Zammad only or can we have it as elasticsearch only, similar to postgres?

Reading https://github.com/zammad/zammad-docker-compose?tab=readme-ov-file#running-without-elasticsearch it seems like elasticsearch could be excluded from the stack for "small teams". It appears some maintenance may be required for upgrades which I'm not sure how complicated they are. Please check that a bit further.

image: bitnami/elasticsearch:${ELASTICSEARCH_VERSION:-8.18.0}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
image: bitnami/elasticsearch:${ELASTICSEARCH_VERSION:-8.18.0}
image: bitnami/elasticsearch:8.18.0

restart: always
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

restart does not exist for stack I believe, see deploy.restart_policy.condition (https://docs.docker.com/reference/compose-file/deploy/#restart_policy)

volumes:
- zammad_elasticsearch_data:/usr/share/elasticsearch/data
environment:
- discovery.type=single-node

zammad-init:
image: zammad/zammad-docker-compose:latest
restart: on-failure
depends_on:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

depends_on does not exist for stacks I believe

- postgres
- zammad-elasticsearch
volumes:
- zammad_storage:/opt/zammad/storage
environment:
- POSTGRESQL_DB_CREATE=false
- POSTGRESQL_HOST=postgres
- POSTGRESQL_USER_FILE=/run/secrets/POSTGRESQL_USER
- POSTGRESQL_PASS_FILE=/run/secrets/POSTGRESQL_PASS
- POSTGRESQL_DB=zammad
- ELASTICSEARCH_HOST=zammad-elasticsearch
- ELASTICSEARCH_PORT=9200
- ZAMMAD_RAILSSERVER_HOST=zammad-railsserver
- ZAMMAD_WEBSOCKET_HOST=zammad-websocket
- NGINX_SERVER_NAME=zammad.${STACK_DOMAIN}
- REDIS_URL=redis://zammad-redis:6379
secrets:
- source: postgres_role_service_zammad_username
target: POSTGRESQL_USER
- source: postgres_role_service_zammad_password
target: POSTGRESQL_PASS
command: ["zammad-init"]

zammad-railsserver:
image: zammad/zammad-docker-compose:latest
restart: always
depends_on:
- zammad-init
environment:
- POSTGRESQL_HOST=postgres
- POSTGRESQL_USER_FILE=/run/secrets/POSTGRESQL_USER
- POSTGRESQL_PASS_FILE=/run/secrets/POSTGRESQL_PASS
- POSTGRESQL_DB=zammad
- ELASTICSEARCH_HOST=zammad-elasticsearch
- ELASTICSEARCH_PORT=9200
- ZAMMAD_RAILSSERVER_HOST=zammad-railsserver
- ZAMMAD_WEBSOCKET_HOST=zammad-websocket
- REDIS_URL=redis://zammad-redis:6379
secrets:
- source: postgres_role_service_zammad_username
target: POSTGRESQL_USER
- source: postgres_role_service_zammad_password
target: POSTGRESQL_PASS
volumes:
- zammad_storage:/opt/zammad/storage
deploy:
labels:
- traefik.enable=true
- traefik.http.routers.zammad-railsserver.entryPoints=web
- traefik.http.routers.zammad-railsserver.middlewares=redirectscheme
- traefik.http.routers.zammad-railsserver.rule=Host(`zammad.${STACK_DOMAIN}`) && PathPrefix(`/api`)
- traefik.http.routers.zammad-railsserver_secure.entryPoints=web-secure
- traefik.http.routers.zammad-railsserver_secure.rule=Host(`zammad.${STACK_DOMAIN}`) && PathPrefix(`/api`)
- traefik.http.routers.zammad-railsserver_secure.tls.options=mintls13@file
- traefik.http.services.zammad-railsserver.loadbalancer.server.port=3000
command: ["zammad-railsserver"]

zammad-scheduler:
image: zammad/zammad-docker-compose:latest
restart: always
depends_on:
- zammad-init
environment:
- POSTGRESQL_HOST=postgres
- POSTGRESQL_USER_FILE=/run/secrets/POSTGRESQL_USER
- POSTGRESQL_PASS_FILE=/run/secrets/POSTGRESQL_PASS
- POSTGRESQL_DB=zammad
- ELASTICSEARCH_HOST=zammad-elasticsearch
- ELASTICSEARCH_PORT=9200
- ZAMMAD_RAILSSERVER_HOST=zammad-railsserver
- ZAMMAD_WEBSOCKET_HOST=zammad-websocket
- REDIS_URL=redis://zammad-redis:6379

secrets:
- source: postgres_role_service_zammad_username
target: POSTGRESQL_USER
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work? On https://docs.docker.com/reference/compose-file/services/#secrets it reads as if you have to name a file path for target.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right in Swarm mode target: under secrets: needs to be a file path, not a variable name. I'll update it.

- source: postgres_role_service_zammad_password
target: POSTGRESQL_PASS
command: ["zammad-scheduler"]

zammad-redis:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to elasticsearch, can this just be called redis?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Postgraphile you see an unnamed volume:
image
Clicking it reveals that it is mounted by redis under /data:
image
So you can add a volume named redis_data on that path here too.

image: redis:7-alpine
restart: always

zammad-websocket:
image: zammad/zammad-docker-compose:latest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
image: zammad/zammad-docker-compose:latest
image: zammad/zammad-docker-compose:6.5.0-85

maybe?

restart: always
depends_on:
- zammad-init
environment:
- POSTGRESQL_HOST=postgres
- POSTGRESQL_USER_FILE=/run/secrets/POSTGRESQL_USER
- POSTGRESQL_PASS_FILE=/run/secrets/POSTGRESQL_PASS
- POSTGRESQL_DB=zammad
- ELASTICSEARCH_HOST=zammad-elasticsearch
- ELASTICSEARCH_PORT=9200
- ZAMMAD_RAILSSERVER_HOST=zammad-railsserver
- ZAMMAD_WEBSOCKET_HOST=zammad-websocket
- REDIS_URL=redis://zammad-redis:6379
secrets:
- source: postgres_role_service_zammad_username
target: POSTGRESQL_USER
- source: postgres_role_service_zammad_password
target: POSTGRESQL_PASS
command: ["zammad-websocket"]
deploy:
labels:
- traefik.enable=true
- traefik.http.routers.zammad-websocket.entryPoints=web
- traefik.http.routers.zammad-websocket.middlewares=redirectscheme
- traefik.http.routers.zammad-websocket.rule=Host(`zammad.${STACK_DOMAIN}`) && PathPrefix(`/ws`)
- traefik.http.routers.zammad-websocket_secure.entryPoints=web-secure
- traefik.http.routers.zammad-websocket_secure.rule=Host(`zammad.${STACK_DOMAIN}`) && PathPrefix(`/ws`)
- traefik.http.routers.zammad-websocket_secure.tls.options=mintls13@file
- traefik.http.services.zammad-websocket.loadbalancer.server.port=6042

zammad-nginx:
image: zammad/zammad-docker-compose:latest
restart: always
depends_on:
- zammad-init
- zammad-railsserver
- zammad-websocket
environment:
- NGINX_SERVER_NAME=zammad.${STACK_DOMAIN}
- REDIS_URL=redis://zammad-redis:6379
Copy link
Member

@dargmuesli dargmuesli Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I apply the same environment variables as for zammad-websocket the container starts nginx successfully. Also, port 8080 needs to be used, not 80.

volumes:
- zammad_storage:/opt/zammad/storage

deploy:
labels:
- traefik.enable=true
- traefik.http.routers.zammad.rule=Host(`zammad.${STACK_DOMAIN}`)
- traefik.http.routers.zammad.entryPoints=web
- traefik.http.routers.zammad.middlewares=redirectscheme
- traefik.http.routers.zammad_secure.rule=Host(`zammad.${STACK_DOMAIN}`)
- traefik.http.routers.zammad_secure.entryPoints=web-secure
- traefik.http.routers.zammad_secure.tls=true
- traefik.http.routers.zammad_secure.tls.options=mintls13@file
- traefik.http.services.zammad.loadbalancer.server.port=80
command: ["zammad-nginx"]
command: ["sh", "-c", "sleep 60 && zammad-nginx"]

redpanda:
# You can access the event streaming platform's ui as described under `redpanda-console`.
command:
Expand Down Expand Up @@ -390,6 +552,8 @@ services:
- postgres_role_service_postgraphile_username
- postgres_role_service_vibetype_password
- postgres_role_service_vibetype_username
- postgres_role_service_zammad_username
- postgres_role_service_zammad_password
- sqitch_target
volumes:
- ../../../sqitch/:/srv/app/
Expand Down Expand Up @@ -551,3 +715,5 @@ volumes:
redpanda_data:
# The message queue's data.
{}
zammad_elasticsearch_data: {}
zammad_storage: {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
zammad_storage: {}
zammad_data: {}

Loading