Skip to content

Commit

Permalink
Document 'How to run rails/rake commands in containers'. (#340)
Browse files Browse the repository at this point in the history
* Document 'How to run rails/rake commands in containers'.

* Use shorter path to docker-entrypoint.sh.
  • Loading branch information
mgruner committed Aug 24, 2023
1 parent e2145fa commit fb3d89c
Showing 1 changed file with 29 additions and 12 deletions.
41 changes: 29 additions & 12 deletions install/docker-compose.rst
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
Install with Docker Compose
***************************

.. warning::
.. warning::

We currently do not support Docker environments in productive use.
We currently do not support Docker environments in productive use.
It's no problem if you run Zammad on docker, however, support is only
provided for Zammad as application!

.. note::

Docker Compose environments require deeper system know how.
If you're not too familiar with Docker and the way it works, you may want
Docker Compose environments require deeper system know how.
If you're not too familiar with Docker and the way it works, you may want
to stick with :doc:`the package installation </install/package/>` instead.

Docker is a container-based software framework for automating deployment of
applications. Compose is a tool for defining and running multi-container Docker
Docker is a container-based software framework for automating deployment of
applications. Compose is a tool for defining and running multi-container Docker
applications.

Zammads docker images are hosted on `Dockerhub`_.

.. _Dockerhub:
https://hub.docker.com/r/zammad/zammad-docker-compose/

.. warning::
.. warning::

Never use the ``latest`` tag. Use a tag which has a version attached.

Expand All @@ -31,7 +31,7 @@ Zammads docker images are hosted on `Dockerhub`_.
Install Docker Environment
==========================

This documentation expects you already have a working Docker Compose
This documentation expects you already have a working Docker Compose
environment. You can find the required documentations for these steps below:

* `Docker Engine <https://docs.docker.com/engine/installation/>`_
Expand Down Expand Up @@ -78,8 +78,8 @@ host's settings to ensure a clean runtime.
Step 3: Adjust Environment as needed
------------------------------------

In some cases our default environment is not what a docker-compose user is
looking for. To remove complexity from this page, we outsourced information on
In some cases our default environment is not what a docker-compose user is
looking for. To remove complexity from this page, we outsourced information on
this topic.

See :doc:`/install/docker-compose/environment`
Expand All @@ -88,12 +88,29 @@ Step 4: Start Zammad using DockerHub images
-------------------------------------------

.. warning::
Before starting your containers ensure to not use default login data for

Before starting your containers ensure to not use default login data for
your Zammad database! See Step 3!

.. code-block:: sh
$ docker compose up -d
.. hint:: **🔧 How to run rails/rake commands in containers**

The docker entrypoint script sets up environment variables required by Zammad to function properly.
That is why calling ``rails`` / ``rake`` on the console should be done via one of the following methods:

.. code-block:: sh
$ docker compose run --rm zammad-railsserver rails r '...your rails command here...'
This will run the command via the docker entrypoint and is recommended. In case you require the use of ``docker exec``, you can use the following command:

.. code-block:: sh
$ docker exec zammad-docker-compose-zammad-railsserver-1 /docker-entrypoint.sh rails r '...your rails command here...'
This will manually invoke the docker entrypoint and pass the desired command to it for execution in the proper environment.

.. include:: /install/includes/next-steps.rst

0 comments on commit fb3d89c

Please sign in to comment.