yt-dlp-bot/docker-compose.yml

93 lines
1.9 KiB
YAML
Raw Normal View History

2022-10-14 03:55:18 +08:00
version: "3.8"
2022-02-04 06:21:27 +08:00
services:
2022-11-03 01:56:19 +08:00
base-image:
image: yt-base-image
build:
2022-12-24 20:26:55 +08:00
dockerfile: base.Dockerfile
2022-11-03 01:56:19 +08:00
deploy:
mode: replicated
replicas: 0
2022-02-04 06:21:27 +08:00
api:
container_name: yt_api
build:
context: .
dockerfile: api/Dockerfile
env_file:
- envs/.env_common
- envs/.env_api
restart: unless-stopped
ports:
- "1984:8000"
2022-11-03 01:56:19 +08:00
command: bash -c "./start.sh && uvicorn main:app --host 0.0.0.0 --port 8000"
2022-02-04 06:21:27 +08:00
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: >
2022-11-03 01:56:19 +08:00
bash -c "./start.sh && python main.py"
2022-02-04 06:21:27 +08:00
depends_on:
- postgres
- rabbitmq
- worker
- api
2022-06-11 04:35:48 +08:00
volumes:
- "shared-tmpfs:/tmp/download_tmpfs"
2022-02-04 06:21:27 +08:00
worker:
container_name: yt_worker
build:
context: .
dockerfile: worker/Dockerfile
env_file:
- envs/.env_common
- envs/.env_worker
restart: unless-stopped
command: >
2022-11-03 01:56:19 +08:00
bash -c "alembic upgrade head && ./start.sh && python main.py"
2022-02-04 06:21:27 +08:00
depends_on:
- postgres
- rabbitmq
volumes:
2022-06-11 04:35:48 +08:00
- "/data/downloads:/filestorage"
- "shared-tmpfs:/tmp/download_tmpfs"
2022-02-04 06:21:27 +08:00
postgres:
container_name: yt_postgres
2022-10-14 03:55:18 +08:00
image: "postgres:14"
2022-02-04 06:21:27 +08:00
env_file:
- envs/.env_common
ports:
- "5435:5432"
2022-11-03 01:56:19 +08:00
restart: unless-stopped
2022-02-04 06:21:27 +08:00
volumes:
- pgdata:/var/lib/postgresql/data
rabbitmq:
2022-10-14 04:24:48 +08:00
image: "rabbitmq:3.11-management-alpine"
2022-02-04 06:21:27 +08:00
container_name: yt_rabbitmq
ports:
- "25672:5672"
- "15672:15672"
2022-11-03 01:56:19 +08:00
restart: unless-stopped
2022-02-04 06:21:27 +08:00
redis:
image: "redis:alpine"
container_name: yt_redis
2022-11-03 01:56:19 +08:00
restart: unless-stopped
2022-02-04 06:21:27 +08:00
volumes:
pgdata:
2022-06-11 04:35:48 +08:00
shared-tmpfs:
driver: local
driver_opts:
type: "tmpfs"
device: "tmpfs"
o: "size=5120m,uid=1000"