11# How to create screenshots in production
22
3- The production environment uses ` docker compose ` to start the message
4- queue, one metadata worker and four instances of the screenshot worker (to
5- parallelize the screenshot processes).
6-
73In production, you * must* run all commands described in the
8- [ README] ( README.md ) inside Docker containers. To avoid long command lines,
9- we have encapsulated the commands in a [ ` Makefile ` ] ( Makefile ) and the
10- shell script ` queue_screenshots.sh ` .
4+ [ README] ( README.md ) inside Docker containers. The production environment
5+ uses ` docker compose ` to start the message queue, one metadata worker and
6+ four instances of the screenshot worker (to parallelize the screenshot
7+ processes).
8+
119
1210## Creating Screenshots
1311
@@ -77,11 +75,17 @@ You can get a unified stream of log output (with timestamps) by running
7775By default, the workers should start with the ` --verbose ` flag
7876(see ` entrypoint ` in the ` docker-compose ` file).
7977
80-
8178### Show queue and message count
8279
8380 docker compose exec rabbitmq bash -c 'rabbitmqctl list_queues'
8481
82+ ### Flushing all commands from the queue
83+
84+ make shutdown-workers
85+
86+ This will stop all containers * and* delete their storage volumes, making
87+ the queue empty.
88+
8589### Refreshing the metadata summary
8690
8791Run the command
@@ -93,4 +97,25 @@ the overview page for Shutterbug, based on the existing metadata files. If
9397a metadata file is invalid, the metadata worker will show a log message
9498and ignore the file.
9599
100+ ## Background Information: How the docker compose environment works
101+
102+ The production environment uses * two* files to define the setup for ` docker compose ` :
103+ ` docker-compose.yml ` and ` docker-compose.prod.yml ` . The latter overrides
104+ settings in the former. See [ Merge Compose Files] ( https://docs.docker.com/compose/how-tos/multiple-compose-files/merge/ )
105+ from the official documentation.
106+
107+ ** Do not** use ` docker compose ` commands without specifying both files! To
108+ make your job easer and to avoid typing long command lines, we have
109+ encapsulated some commands in the [ ` Makefile ` ] ( Makefile ) and the shell
110+ script ` queue_screenshots.sh ` .
111+
112+ ` docker-compose.prod.yml ` is * not* part of the ` banner-screenshots `
113+ repository but part of the infrastructure repository. The deployment
114+ script for ` banner-screenshots ` will put it into the right place.
115+
116+ You can test the ` docker compose ` environment: Both ` Makefile ` and
117+ ` queue_screenshots.sh ` will try to fall back to the file
118+ ` docker-compose.dev.yml ` if the file ` docker-compose.prod.yml ` does not
119+ exist. You can create the ` docker-compose.dev.yml ` file by copying the
120+ contents of ` docker-compose.dev.example.yml ` into it.
96121
0 commit comments