yt-dlp-bot/docker-compose.yml
2022-12-24 14:26:55 +02:00

92 lines
1.9 KiB
YAML

version: "3.8"
services:
base-image:
image: yt-base-image
build:
dockerfile: base.Dockerfile
deploy:
mode: replicated
replicas: 0
api:
container_name: yt_api
build:
context: .
dockerfile: api/Dockerfile
env_file:
- envs/.env_common
- envs/.env_api
restart: unless-stopped
ports:
- "1984:8000"
command: bash -c "./start.sh && uvicorn main:app --host 0.0.0.0 --port 8000"
depends_on:
- postgres
- rabbitmq
- worker
- redis
bot:
container_name: yt_bot
build:
context: .
dockerfile: bot/Dockerfile
env_file:
- envs/.env_common
- envs/.env_bot
restart: unless-stopped
command: >
bash -c "./start.sh && python main.py"
depends_on:
- postgres
- rabbitmq
- worker
- api
volumes:
- "shared-tmpfs:/tmp/download_tmpfs"
worker:
container_name: yt_worker
build:
context: .
dockerfile: worker/Dockerfile
env_file:
- envs/.env_common
- envs/.env_worker
restart: unless-stopped
command: >
bash -c "alembic upgrade head && ./start.sh && python main.py"
depends_on:
- postgres
- rabbitmq
volumes:
- "/data/downloads:/filestorage"
- "shared-tmpfs:/tmp/download_tmpfs"
postgres:
container_name: yt_postgres
image: "postgres:14"
env_file:
- envs/.env_common
ports:
- "5435:5432"
restart: unless-stopped
volumes:
- pgdata:/var/lib/postgresql/data
rabbitmq:
image: "rabbitmq:3.11-management-alpine"
container_name: yt_rabbitmq
ports:
- "25672:5672"
- "15672:15672"
restart: unless-stopped
redis:
image: "redis:alpine"
container_name: yt_redis
restart: unless-stopped
volumes:
pgdata:
shared-tmpfs:
driver: local
driver_opts:
type: "tmpfs"
device: "tmpfs"
o: "size=5120m,uid=1000"