Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the proxy example to fit the current version of compose file #430

Closed
Jan-NiklasB opened this issue Sep 16, 2024 · 3 comments
Closed

Comments

@Jan-NiklasB
Copy link
Contributor

Jan-NiklasB commented Sep 16, 2024

Infos

  • Docker version: 27.2.1
  • Docker-compose version: 1.27.4
  • Operating system (Docker host): Ubuntu 22.04 LTS

Expected behavior

  • Adding the "environment" section to the zammad-nginx section with the vars needed like "VIRTUAL_HOST: xyz.domain.tld" works out of the box

Actual behavior

  • I needed to try around for some hours, since adding the environment-section to the zammad-nginx section in the current docker-compose.yml resulted in the nginx getting stuck on waiting for the init container.

The final solution was to omit the environment section in the zammad-nginx section and instead add the vars to the x-shared -> environment-section

Steps to reproduce the behavior

  • Setup the current version and modify the the zammad-nginx section as follows:
zammad-nginx:
    environment:
      VIRTUAL_HOST: ${VHOST:-support.domain.tld}
      LETSENCRYPT_HOST: ${LE_HOST:-support.domain.tld}
    <<: *zammad-service
    command: ["zammad-nginx"]
    expose:
      - "${NGINX_PORT:-8080}"
    ports:
      - "${NGINX_EXPOSE_PORT:-8080}:${NGINX_PORT:-8080}"
    depends_on:
      - zammad-railsserver
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Nov 16, 2024
@mgruner mgruner removed the stale label Nov 18, 2024
@janitor-of-code
Copy link

I'd assume that is because of the YAML syntax around anchors:
the environment from the template propably gets overwritten by the new environment variable.

Whoever wrote the templating seemed to already think of this:

# zammad-docker-compose/docker-compose.yml
x-shared:
  zammad-service: &zammad-service
    environment: &zammad-environment  # <-- this line
      MEMCACHE_SERVERS: ${MEMCACHE_SERVERS:-zammad-memcached:11211}

So I think we just have to merge the envs:

services:
  zammad-nginx:
  <<: *zammad-service
    environment:
      <<: *zammad-environment  # <-- this line
      VIRTUAL_HOST: "helpdesk.domain.tld"
      NGINX_SERVER_SCHEME: "https"

@mgruner
Copy link
Collaborator

mgruner commented Jan 17, 2025

We recommend to never modify the docker-compose.yml file directly, but instead use another file that is loaded together with it: https://docs.zammad.org/en/latest/install/docker-compose.html#customizing-the-zammad-stack

This allows you to stay in sync with upstream changes, and it will also work with the syntax of the example files.

@mgruner mgruner closed this as not planned Won't fix, can't repro, duplicate, stale Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants