Deskpro is comprised of multiple components or services. We publish a single image that is capable of running all services required for an instance of Deskpro.
Some people refer to this type of image as a "fat image" or "fat container" because it technically does more than one specific thing.
For example, Deskpro needs to handle HTTP requests, it has to run scheduled background tasks, it needs to run background workers for things like email processing, etc. When you run a Deskpro image, you specify which services you want to run -- we call this the "run mode".
The simplest thing would be to run just 1 container that runs all services at once. However, we recommend running at least two containers: One specifically to handle HTTP requests, and then a second general-purpose "tasks" container to handle scheduled tasks, background tasks, and workers. As your instance becomes larger, you may need to scale the number of instances to handle your particular loads.
You specify run mode by passing a particular keyword as the docker command.
docker run [OPTIONS] deskpro/deskpro-product:$DPVERSION-onprem RUN_MODE_HERE
# see https://docs.docker.com/engine/reference/commandline/run/ copy
Mode: combined
The combined
mode will run the web server and background tasks in a single container. Useful as a quick way to get up and running, but not recommended for production because you may have tasks compete for resources.
(This is the same as: svc web tasks
).
Mode: web (default)
The web
mode will run the internal HTTP server with php-fpm for serving HTTP requests from your upstream server. The internal HTTP server accepts requests over port 80. If you enable HTTPS, then it will also accept secure requests over port 443.
(This is the same as: svc web
).
Mode: tasks
The tasks
mode will execute all background tasks (cron, queue workers, email processing, etc).
Deskpro has a variety of tasks. When running in tasks
mode, all tasks are run in a single container by looping through them synchronously.
(This is the same as: svc tasks
).
Mode: svc
Running with the command svc [service...]
will run only the services you specify. This is typically only used for environments that need the flexibility to scale specific services independently. (Technically, all other run modes are just aliases for running this mode with a particlar set of services.)
The services you can run include:
web
-- Runs the web server and php-fpm for handling HTTP requests.tasks
-- Runs background tasks such as email collection/processing, scheduled tasks, and workers.email_collect
-- email collection service (see "Running a standalone email processing container")email_process
-- email processing service (see "Running a standalone email processing container")
If you plan on running email collection/processing, then you need to do a little bit of setup to disable those tasks on your general tasks server. See "Running a standalone email processing container".
Mode: none
The none
mode simply runs the container with no services. This can be useful for debugging. For example, you could start a container and then run docker exec
to get a shell into the container.
Mode: bash
The bash
mode starts the container into an interactive bash shell. This is useful for debugging or performing maintenance tasks.
# Example
docker run --env-file "config.env" -it --rm deskpro/deskpro-product:$DPVERSION-onprem bash copy
Mode: exec
Running with the command exec <YOUR_COMMAND>
starts the container and immediately runs the command you specified.
# Example - run some PHP code
docker run --env-file "config.env" -it --rm deskpro/deskpro-product:$DPVERSION-onprem exec php -r 'echo "hello world\n";'
# Example - Execute a MySQL query and show results
docker run --env-file "config.env" -it --rm deskpro/deskpro-product:latest:$DPVERSION-onprem exec mysql-read -e 'SHOW DATABASES();'
# Example - Get an interactive mysql shell
docker run --env-file "config.env" -it --rm deskpro/deskpro-product:$DPVERSION-onprem exec mysql-primary copy
Please log in or register to submit a comment.