From 3548f12deba7d35bc302424fae628cdfa5602caa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 28 Jan 2024 18:30:16 +0100 Subject: [PATCH] Added info on how to execute commands inside docker container to docs --- docs/usage/console_commands.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/usage/console_commands.md b/docs/usage/console_commands.md index cba9d366..00431a34 100644 --- a/docs/usage/console_commands.md +++ b/docs/usage/console_commands.md @@ -8,11 +8,23 @@ parent: Usage Part-DB provides some console commands to display various information or perform some tasks. The commands are invoked from the main directory of Part-DB with the command `php bin/console [command]` in the context -of the database user (so usually the webserver user), so you maybe have to use `sudo` or `su` to execute the commands. +of the database user (so usually the webserver user), so you maybe have to use `sudo` or `su` to execute the commands: + +```bash +sudo -u www-data php bin/console [command] +``` You can get help for every command with the parameter `--help`. See `php bin/console` for a list of all available commands. +If you are running Part-DB in a docker container, you must either execute the commands from a shell inside a container, +or use the `docker exec` command to execute the command directly inside the container. For example if you docker container +is named `partdb`, you can execute the command `php bin/console cache:clear` with the following command: + +```bash +docker exec --user=www-data partdb php bin/console cache:clear +``` + ## User management commands * `php bin/console partdb:users:list`: List all users of this Part-DB instance