Skip to content

Commit 53b2776

Browse files
authored
Fixes #610 - Added guides for docker compose deployment scenarios
1 parent aa5643a commit 53b2776

File tree

5 files changed

+315
-45
lines changed

5 files changed

+315
-45
lines changed
Loading
Loading
Loading

install/docker-compose.rst

+96-45
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,52 @@ graphical docker front ends like
99

1010
.. hint::
1111

12-
We do not provide support in terms of Docker (-Compose) or Portainer specific problems.
13-
If you choose to run Zammad via Docker, support is only provided for the Zammad application.
12+
We do not provide support in terms of Docker (-Compose) or Portainer specific
13+
problems. If you choose to run Zammad via Docker, support is only provided
14+
for the Zammad application.
1415

1516
Prerequisites
1617
-------------
1718

1819
* This documentation expects you already have a working
1920
`Docker Compose <https://docs.docker.com/compose/>`_ environment.
2021
* Make sure to have at least 4 GB of RAM to run the containers.
21-
* You're required to adjust your host's settings to run Elasticsearch properly:
22+
* You should adjust your host's settings to run Elasticsearch properly:
2223

2324
.. code-block:: sh
2425
25-
$ sysctl -w vm.max_map_count=262144
26+
sysctl -w vm.max_map_count=262144
2627
2728
Deployment with Portainer
2829
-------------------------
2930

30-
The easiest way to get Zammad running is via a graphical docker UI. We recommend `Portainer <https://www.portainer.io/>`_.
31-
For installation instructions, check out `Portainer's documentation <https://docs.portainer.io/>`_.
31+
The easiest way to get Zammad running is via a graphical docker UI. We recommend
32+
`Portainer <https://www.portainer.io/>`_.
33+
For installation instructions, check out
34+
`Portainer's documentation <https://docs.portainer.io/>`_.
3235

33-
Step 1: **Add Stack**
36+
Step 1: Add Stack
3437
In the Portainer GUI (e.g. ``https://yourdomain.tld:9443``),
3538
choose your target environment, select **Stacks** and
3639
choose **Add stack** as you can see in the screenshot below.
3740

38-
Step 2: **Build From Repository**
41+
Step 2: Build From Repository
3942
Switch to **Repository** build method and provide the information below:
4043

4144
- **Name**: enter a desired name of the stack
4245
- **Repository URL**: ``https://github.com/zammad/zammad-docker-compose``
4346
- **Repository reference**: ``refs/heads/master``
4447
- **Compose path**: ``docker-compose.yml`` (default)
4548

46-
Optional: if you need to provide
47-
:doc:`environment variables <./docker-compose/environment>`, you can enter
48-
them in the **Environment variable** section or even upload a ``.env`` file.
49-
See the `example env template <https://github.com/zammad/zammad-docker-compose/blob/master/.env.dist>`_.
49+
If you want to customize the stack, read on in
50+
:ref:`the customization section <customizing-stack>` below.
5051

51-
Zammad runs on port ``8080`` by default. If you want to use another port, you can set it via the variable ``NGINX_EXPOSE_PORT``.
52+
Zammad runs on port ``8080`` by default. If you want to use another port, you
53+
can set it via the variable ``NGINX_EXPOSE_PORT``.
5254

53-
Step 3: **Deploy the Stack**
54-
After the stack is ready, you can access Zammad via the configured docker host and port, e.g. ``http://localhost:8080/``.
55+
Step 3: Deploy the Stack
56+
After the stack is ready, you can access Zammad via the configured docker
57+
host and port, e.g. ``http://localhost:8080/``.
5558

5659
.. figure:: /images/install/docker-compose/portainer/portainer-stacks.png
5760
:alt: Screenshot showing portainer UI with stacks section and highlighted "Add stack" button
@@ -63,52 +66,75 @@ Step 3: **Deploy the Stack**
6366

6467
Stack creation with provided information in **Repository** screen
6568

66-
6769
Deployment with Docker-Compose
6870
------------------------------
6971

70-
Step 1: **Clone the GitHub Repo**
72+
Step 1: Clone the GitHub Repo
7173
.. code-block:: sh
7274
73-
$ git clone https://github.com/zammad/zammad-docker-compose.git
75+
git clone https://github.com/zammad/zammad-docker-compose.git
7476
7577
Make sure to run ``git pull`` frequently to fetch updates.
7678
Alternatively, you can download the files from
7779
`the releases page <https://github.com/zammad/zammad-docker-compose/releases>`_.
7880

79-
Step 2: **Adjust Environment as Needed**
80-
In some cases our default environment is not what a docker-compose user is
81-
looking for. See :doc:`/install/docker-compose/environment` for details on
82-
which settings can be configured.
83-
84-
.. note:: If you want to use a ``.env`` file, you can use the provided
85-
``.env.dist`` file and copy it to ``.env``. That way it will be picked
86-
up by Docker-Compose automatically and not overwritten during updates.
81+
Step 2: Adjust Environment as Needed
82+
In some cases, our default environment is not what a docker-compose user is
83+
looking for. You can customize the stack using pre-defined scenarios and
84+
adjust environment variables. Jump to the
85+
:ref:`customization section <customizing-stack>` below to find more
86+
information.
8787

88-
Zammad runs on port ``8080`` by default. If you want to use another port, you can set it via the variable ``NGINX_EXPOSE_PORT``.
88+
Zammad runs on port ``8080`` by default. If you want to use another port, you
89+
can set it via the variable ``NGINX_EXPOSE_PORT``.
8990

9091
Step 3: Start the stack
9192
.. code-block:: sh
9293
93-
$ cd zammad-docker-compose
94-
$ docker compose up -d
94+
cd zammad-docker-compose
95+
docker compose up -d
9596
96-
After the stack is ready, you can access Zammad via the configured docker host and port, e.g. ``http://localhost:8080/``.
97+
Optional: Use an additional ``.yml`` file from the scenarios folder to
98+
apply one of the :doc:`pre-defined scenarios <docker-compose/docker-compose-scenarios>`.
99+
100+
After the stack is ready, you can access Zammad via the configured docker
101+
host and port, e.g. ``http://localhost:8080/``.
102+
103+
Exposing the Stack via HTTPS
104+
----------------------------
105+
106+
To publish a Zammad stack on the internet, it needs be secured via the HTTPS
107+
protocol. To achieve that without modifying the Zammad stack, you can:
108+
109+
- Use a reverse proxy like Nginx Proxy Manager (NPM). It has a GUI that provides
110+
an easy `Letsencrypt <https://letsencrypt.org/>`_ integration.
111+
- Use a cloudflare tunnel, which provides SSL termination.
112+
113+
Both scenarios are covered in the
114+
:doc:`Docker compose scenarios section <docker-compose/docker-compose-scenarios>`.
115+
116+
.. _customizing-stack:
97117

98118
Customizing the Zammad Stack
99119
----------------------------
100120

101-
Sometimes it's necessary to apply local changes to the Zammad docker stack, e.g. to
102-
include additional services. If you plan to do so, we recommend that you do not change
103-
the ``docker-compose.yml`` file, but instead create a local ``docker-compose.override.yml``
104-
that includes all your modifications. Docker-Compose will
105-
`automatically load this file and merge its changes into your stack <https://docs.docker.com/compose/multiple-compose-files/merge/>`_.
121+
The Zammad stack can be customized by loading additional scenario files for
122+
common use cases. For example, you can deploy the stack with an included Nginx
123+
Proxy Manager (NPM) or with disabled Postgres or Elasticsearch services, in case
124+
you already have these services running.
125+
126+
Please see the :doc:`Docker compose scenarios section <docker-compose/docker-compose-scenarios>`.
127+
128+
To adjust the stack and settings, use
129+
:doc:`docker specific environment variables </install/docker-compose/environment>`.
106130

107131
.. toctree::
108132
:hidden:
109133
:maxdepth: 1
110134

111135
/install/docker-compose/environment
136+
/install/docker-compose/docker-compose-scenarios
137+
112138

113139
How to Run Commands in the Stack
114140
--------------------------------
@@ -117,20 +143,45 @@ The docker entrypoint script sets up environment variables required by Zammad
117143
to function properly. That is why calling ``rails`` or ``rake`` on the console
118144
should be done via one of the following methods:
119145

120-
.. code-block:: sh
146+
.. tabs::
147+
148+
.. tab:: Via Portainer GUI
149+
150+
In your Portainer GUI, go to the container view and select the running
151+
rails container from your Zammad stack. Click on the **Exec Console**
152+
icon in the "Quick Actions" column.
153+
154+
.. figure:: /images/install/docker-compose/portainer/portainer-exec-console.png
155+
:alt:
156+
:width: 70%
157+
158+
In the "Execute" dialog, select the "rails console" entry point as you
159+
can see in the screenshot:
160+
161+
.. figure:: /images/install/docker-compose/portainer/portainer-execute-command.png
162+
:alt:
163+
:width: 70%
164+
165+
.. tab:: Via console
166+
167+
Directly execute a specific command:
168+
169+
.. code-block:: sh
170+
171+
docker compose run --rm zammad-railsserver rails r '...your rails command here...'
121172
122-
# Directly execute a specific command:
173+
Run the interactive rails console to manually enter Rails commands:
123174

124-
$ docker compose run --rm zammad-railsserver rails r '...your rails command here...'
175+
.. code-block:: sh
125176
126-
# Run the interactive rails console to manually enter Rails commands:
177+
docker compose run --rm zammad-railsserver rails c
127178
128-
$ docker compose run --rm zammad-railsserver rails c
179+
Via ``docker exec``:
129180

130-
# Via 'docker exec':
181+
.. code-block:: sh
131182
132-
$ docker exec zammad-docker-compose-zammad-railsserver-1 /docker-entrypoint.sh rails r '...your rails command here...'
183+
docker exec zammad-docker-compose-zammad-railsserver-1 /docker-entrypoint.sh rails r '...your rails command here...'
133184
134-
If you need to retrieve information from the rails server, you can place
135-
for example ``pp`` (pretty print) in front of your rails command. This
136-
leads to an output in your terminal.
185+
If you need to retrieve information from the rails server, you can place
186+
for example ``pp`` (pretty print) in front of your rails command. This
187+
leads to an output in your terminal.

0 commit comments

Comments
 (0)