Skip to content

Commit

Permalink
Simplified command section
Browse files Browse the repository at this point in the history
  • Loading branch information
mgruner committed Jun 21, 2024
1 parent 0209ed3 commit da97b57
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions install/docker-compose.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,39 +110,27 @@ Customization
if the ``docker-compose.yml`` has changed and if so to adjust it accordingly.


Additional Information
======================

Running Rails/Rake Commands in Containers
-----------------------------------------

# TODO
How to Run Commands in the Stack
================================

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

.. code-block:: sh
# Directly execute a specific command:
$ docker compose run --rm zammad-railsserver rails r '...your rails command here...'
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
# Run the interactive rails console to manually enter Rails commands:
$ 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
# Via 'docker exec':
$ 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.

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.
Expand Down

0 comments on commit da97b57

Please sign in to comment.