Skip to content

Commit

Permalink
Fixes #478 - Extension for Rails console in Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ralf401 authored Jun 4, 2024
1 parent ab99222 commit 70011e0
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions install/docker-compose.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,34 @@ Step 4: Start Zammad using DockerHub images
.. 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:
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:
This will run the command via the docker entrypoint and is recommended.

Alternatively, you can run the rails console interactively by running:

.. code-block:: sh
$ docker compose run --rm zammad-railsserver rails c
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.
This will manually invoke the docker entrypoint and pass the desired command
to it for execution in the proper environment.

If you need to retrieve information from the rails server, you can place
for example ``pp`` (pretty print) in front of your rails command. This
leads to an output in your terminal.

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

0 comments on commit 70011e0

Please sign in to comment.