docker-compose: streamline Redis and Telegram bot configurations; ensure consistent environment variable usage and health checks
This commit is contained in:
parent
e4233c506b
commit
68983bbd32
@ -1,52 +1,44 @@
|
||||
services:
|
||||
redis:
|
||||
env_file:
|
||||
- .env
|
||||
image: redis:8-alpine
|
||||
restart: always
|
||||
env_file:
|
||||
- .env
|
||||
command: ['redis-server', '--requirepass', '${REDIS_PASSWORD}']
|
||||
ports:
|
||||
- "127.0.0.1:6379:6379"
|
||||
- '127.0.0.1:6379:6379'
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
command: ["redis-server", "--requirepass", "${REDIS_PASSWORD}"]
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.50'
|
||||
memory: 512M
|
||||
reservations:
|
||||
cpus: '0.25'
|
||||
memory: 256M
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
test: ['CMD', 'redis-cli', 'ping']
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
|
||||
next-downloader-bot:
|
||||
env_file:
|
||||
- .env
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./apps/bot/Dockerfile
|
||||
restart: always
|
||||
env_file:
|
||||
- .env
|
||||
depends_on:
|
||||
- redis
|
||||
- telegram-bot-api
|
||||
|
||||
telegram-bot-api:
|
||||
image: aiogram/telegram-bot-api:latest
|
||||
restart: always
|
||||
env_file:
|
||||
- .env
|
||||
image: aiogram/telegram-bot-api:latest
|
||||
# environment:
|
||||
# TELEGRAM_API_ID: "<api-id>"
|
||||
# TELEGRAM_API_HASH: "<api-hash>"
|
||||
ports:
|
||||
- '127.0.0.1:8081:8081'
|
||||
volumes:
|
||||
- telegram-bot-api-data:/var/lib/telegram-bot-api
|
||||
ports:
|
||||
- "127.0.0.1:8081:8081"
|
||||
|
||||
volumes:
|
||||
telegram-bot-api-data:
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
services:
|
||||
redis:
|
||||
env_file:
|
||||
- .env
|
||||
image: redis:8-alpine
|
||||
restart: always
|
||||
env_file:
|
||||
- .env
|
||||
command: ['redis-server', '--requirepass', '${REDIS_PASSWORD}']
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
command: ['redis-server', '--requirepass', '${REDIS_PASSWORD}']
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
@ -23,26 +23,31 @@ services:
|
||||
start_period: 30s
|
||||
|
||||
next-downloader-bot:
|
||||
image: "${DOCKERHUB_USERNAME}/next-downloader-bot:${BOT_IMAGE_TAG}"
|
||||
image: '${DOCKERHUB_USERNAME}/next-downloader-bot:${BOT_IMAGE_TAG}'
|
||||
restart: always
|
||||
env_file:
|
||||
- .env
|
||||
restart: always
|
||||
depends_on:
|
||||
- redis
|
||||
- telegram-bot-api
|
||||
|
||||
telegram-bot-api:
|
||||
restart: always
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.50'
|
||||
memory: 512M
|
||||
|
||||
telegram-bot-api:
|
||||
image: aiogram/telegram-bot-api:latest
|
||||
restart: always
|
||||
env_file:
|
||||
- .env
|
||||
image: aiogram/telegram-bot-api:latest
|
||||
volumes:
|
||||
- telegram-bot-api-data:/var/lib/telegram-bot-api
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.50'
|
||||
memory: 512M
|
||||
|
||||
volumes:
|
||||
telegram-bot-api-data:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user