fix: container DB race condition, feat: separate images for app & worker, chore: example compose & .env files
This commit is contained in:
93
docs/examples/compose.yml
Normal file
93
docs/examples/compose.yml
Normal file
@@ -0,0 +1,93 @@
|
||||
services:
|
||||
# This container runs the actual web app in a php:8.4-apache
|
||||
# base container. If not running behind a reverse proxy,
|
||||
# inject your SSL certificates into this container
|
||||
app:
|
||||
image: registry.caldwell.digital/home/torsearch:test-app
|
||||
ports:
|
||||
- "8006:80"
|
||||
env_file:
|
||||
- .env
|
||||
depends_on:
|
||||
database:
|
||||
condition: service_healthy
|
||||
|
||||
# Downloads happen asynchronously in this container. Replicate
|
||||
# this container to run multiple downloads simultaneously.
|
||||
# Map your "movies" folder to /var/download/movies
|
||||
# Map your TV shows folder to /var/download/tvshows
|
||||
# If your folders are on another machine, use an NFS volume.
|
||||
# This container runs a Symfony worker process.
|
||||
# See: https://symfony.com/doc/current/messenger.html
|
||||
worker:
|
||||
image: registry.caldwell.digital/home/torsearch:test-worker
|
||||
volumes:
|
||||
- ./downloads/movies:/var/download/movies
|
||||
- ./downloads/tvshows:/var/download/tvshows
|
||||
command: php ./bin/console messenger:consume async -v --time-limit=3600 --limit=10
|
||||
env_file:
|
||||
- .env
|
||||
depends_on:
|
||||
app:
|
||||
condition: service_healthy
|
||||
|
||||
# This container handles the monitoring for new media. When new
|
||||
# monitors are added, jobs are periodically dispatched to this
|
||||
# container, and the desired media is searched for and downloaded.
|
||||
# This container runs a Symfony worker process.
|
||||
# See: https://symfony.com/doc/current/messenger.html
|
||||
scheduler:
|
||||
image: registry.caldwell.digital/home/torsearch:test-worker
|
||||
volumes:
|
||||
- ./downloads:/var/download
|
||||
command: php ./bin/console messenger:consume scheduler_monitor -vv --time-limit=3600
|
||||
env_file:
|
||||
- .env
|
||||
depends_on:
|
||||
app:
|
||||
condition: service_healthy
|
||||
|
||||
# This container facilitates viewing the progress of downloads
|
||||
# in realtime. It also handles sending alerts and notifications.
|
||||
# The MERCURE_PUBLISHER_JWT key & MERCURE_SUBSCRIBER_JWT_KEY should
|
||||
# match the MERCURE_JWT_SECRET environment variable.
|
||||
mercure:
|
||||
image: dunglas/mercure
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3001:80"
|
||||
environment:
|
||||
SERVER_NAME: ':80'
|
||||
MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
|
||||
MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
|
||||
MERCURE_EXTRA_DIRECTIVES: |
|
||||
cors_origins *
|
||||
anonymous
|
||||
command: /usr/bin/caddy run --config /etc/caddy/dev.Caddyfile
|
||||
volumes:
|
||||
- mercure_data:/data
|
||||
- mercure_config:/config
|
||||
|
||||
database:
|
||||
image: mariadb:10.11.2
|
||||
volumes:
|
||||
- mysql:/var/lib/mysql
|
||||
environment:
|
||||
MYSQL_DATABASE: app
|
||||
MYSQL_USERNAME: app
|
||||
MYSQL_PASSWORD: password
|
||||
MYSQL_ROOT_PASSWORD: password
|
||||
healthcheck:
|
||||
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
|
||||
adminer:
|
||||
image: adminer
|
||||
ports:
|
||||
- "8081:8080"
|
||||
|
||||
volumes:
|
||||
mysql:
|
||||
mercure_config:
|
||||
mercure_data:
|
||||
Reference in New Issue
Block a user