diff --git a/.examples/proxy/certs/.gitkeep b/.examples/proxy/certs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.examples/proxy/docker-compose.proxy-example.yml b/.examples/proxy/docker-compose.proxy-example.yml new file mode 100644 index 0000000..74a54ab --- /dev/null +++ b/.examples/proxy/docker-compose.proxy-example.yml @@ -0,0 +1,14 @@ +version: '3.3' +services: + + zammad-nginx: + environment: + - VIRTUAL_HOST=helpdesk.domain.tld + networks: + - default + - proxy_2_zammad + +networks: + proxy_2_zammad: + external: + name: proxy_2_apps diff --git a/.examples/proxy/docker-compose.yml b/.examples/proxy/docker-compose.yml new file mode 100644 index 0000000..16563ab --- /dev/null +++ b/.examples/proxy/docker-compose.yml @@ -0,0 +1,16 @@ +version: '3.3' +services: + frontend: + image: jwilder/nginx-proxy:alpine + restart: always + ports: + - "80:80" + - "443:443" + volumes: + - ./certs:/etc/nginx/certs + - /var/run/docker.sock:/tmp/docker.sock:ro + networks: + - 2_apps + +networks: + 2_apps: \ No newline at end of file diff --git a/README.md b/README.md index a83b498..4dd0832 100644 --- a/README.md +++ b/README.md @@ -18,3 +18,17 @@ https://docs.zammad.org/en/latest/install-docker-compose.html ## Build Status [![Build Status](https://travis-ci.org/zammad/zammad-docker-compose.svg?branch=master)](https://travis-ci.org/zammad/zammad-docker-compose) + +## Using a reverse proxy + +In environments with more then one web applications it is necessary to use a reverse proxy to route connections to port 80 and 443 to the right application. +To run Zammad behind a revers proxy, we provide `docker-compose.proxy-example.yml` as a starting point. + +1. Copy `./.examples/proxy/docker-compose.proxy-example.yml` to your own configuration, e.g. `./docker-compose.prod.yml` + `cp ./.examples/proxy/docker-compose.proxy-example.yml ./docker-compose.prod.yml` +1. Modify the environment variable `VIRTUAL_HOST` and the name of the external network in `./docker-compose.prod.yml` to fit your environment. +1. Run docker-composer commands with the default and your configuration, e.g. `docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d` + +See `.examples/proxy/docker-compose.yml` for an example proxy project. + +Like this, you can add your `docker-compose.prod.yml` to a branch of your Git repository and stay up to date by merging changes to your branch.