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: .
2023-02-03 01:31:07 +08:00
dockerfile: app_api/Dockerfile
2022-02-04 06:21:27 +08:00
env_file:
- envs/.env_common
- envs/.env_api
restart: unless-stopped
ports:
- "1984:8000"
2023-08-03 04:53:49 +08:00
command: bash -c "python start.py && python main.py"
2022-02-04 06:21:27 +08:00
depends_on:
- postgres
- rabbitmq
- worker
- redis
bot:
container_name: yt_bot
build:
context: .
2023-02-03 01:31:07 +08:00
dockerfile: app_bot/Dockerfile
2022-02-04 06:21:27 +08:00
env_file:
- envs/.env_common
- envs/.env_bot
restart: unless-stopped
command: >
2023-03-23 05:24:06 +08:00
bash -c "python start.py && 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: .
2023-02-03 01:31:07 +08:00
dockerfile: app_worker/Dockerfile
2022-02-04 06:21:27 +08:00
env_file:
- envs/.env_common
- envs/.env_worker
restart: unless-stopped
command: >
2023-03-23 05:24:06 +08:00
bash -c "python start.py && alembic upgrade head && 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"
2023-02-05 03:34:03 +08:00
o: "size=7168m,uid=1000"