Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
8 changes: 8 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,11 @@
# ZAMMAD_SCHEDULER_RESOURCES_LIMITS_MEMORY=500M
# ZAMMAD_WEBSOCKET_RESOURCES_LIMITS_CPUS=1.0
# ZAMMAD_WEBSOCKET_RESOURCES_LIMITS_MEMORY=500M

##############################################
# scenarios/disable-nginx-service.yml
# ############################################

# DOCKER_RAILS_BINDHOST=localhost
# DOCKER_RAILS_BIND_PORT=3100

10 changes: 10 additions & 0 deletions .github/tests/disable-nginx-service.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

# shellcheck source=/dev/null
. "$(dirname "$0")/include/functions.sh"

check_stack_start false # do not use nginx

print_heading "check for absence of nginx container"
docker compose ps | grep zammad-nginx
print_heading "Success - nginx container is absent"
12 changes: 10 additions & 2 deletions .github/tests/include/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,16 @@ railsserver_run_command() {
}

check_stack_start() {
dont_use_nginx="$1"

print_heading "wait for zammad to be ready…"
docker compose wait zammad-init
docker compose exec zammad-nginx bash -c "curl --retry 30 --retry-delay 1 --retry-connrefused http://localhost:8080 | grep 'Zammad'"

if [ -z "$dont_use_nginx" ]; then
docker compose exec zammad-nginx bash -c "curl --retry 30 --retry-delay 1 --retry-connrefused http://localhost:8080 | grep 'Zammad'"
else
docker compose exec zammad-railsserver bash -c "curl --retry 30 --retry-delay 1 --retry-connrefused http://localhost:3000 | grep 'Zammad'"
fi

print_heading "Success - Zammad is up :)"
}
}
8 changes: 8 additions & 0 deletions .github/tests/setup/disable-nginx-service.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

set -o errexit

# Disable ES initialization in the test because we don't have an external ES service.
echo "NGINX_ENABLED=false" > .env

docker compose -f docker-compose.yml -f scenarios/disable-nginx-service.yml up --pull always --quiet-pull --detach
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
- apply-resource-limits
- disable-backup-service
- disable-elasticsearch-service
- disable-nginx-service
steps:
- name: Checkout
uses: actions/checkout@v6
Expand Down
23 changes: 23 additions & 0 deletions scenarios/disable-nginx-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
version: "3.8"

#
# Disable the nginx service, for example if there is already a reverse proxy handling
# the connections and you want connect directly to rails from this reverse proxy
#

services:
zammad-nginx:
profiles:
- do-not-start

zammad-railsserver:
environment:
RAILS_SERVE_STATIC_FILES: true
ports:
- "${DOCKER_RAILS_BIND_HOST:-127.0.0.1}:${DOCKER_RAILS_BIND_PORT:-3100}:${ZAMMAD_RAILSSERVER_PORT:-3000}"

zammad-websocket:
ports:
- "${DOCKER_RAILS_BIND_HOST:-127.0.0.1}:${DOCKER_ZAMMAD_WEBSOCKET_BIND_PORT:-6042}:${ZAMMAD_WEBSOCKET_PORT:-6042}"

Loading