- Added Redis service to both docker-compose files for local development and production environments. - Updated bot configuration to utilize the Grammy framework, replacing Telegraf. - Implemented graceful shutdown for the bot, ensuring proper resource management. - Refactored bot commands and removed deprecated message handling logic. - Enhanced environment variable management for Redis connection settings. - Updated dependencies in package.json to include new Grammy-related packages.
54 lines
1022 B
YAML
54 lines
1022 B
YAML
services:
|
|
web:
|
|
image: ${DOCKERHUB_USERNAME}/zapishis-web:${WEB_IMAGE_TAG}
|
|
env_file:
|
|
- .env
|
|
restart: always
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:3000/"]
|
|
interval: 10s
|
|
timeout: 3s
|
|
retries: 5
|
|
networks:
|
|
- app
|
|
- web
|
|
|
|
bot:
|
|
image: ${DOCKERHUB_USERNAME}/zapishis-bot:${BOT_IMAGE_TAG}
|
|
restart: always
|
|
env_file:
|
|
- .env
|
|
depends_on:
|
|
- redis
|
|
networks:
|
|
- app
|
|
|
|
redis:
|
|
image: redis:8-alpine
|
|
restart: always
|
|
env_file:
|
|
- .env
|
|
command: ['redis-server', '--requirepass', '${REDIS_PASSWORD}']
|
|
volumes:
|
|
- redis-data:/data
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: '0.50'
|
|
memory: 512M
|
|
reservations:
|
|
cpus: '0.25'
|
|
memory: 256M
|
|
healthcheck:
|
|
test: ['CMD', 'redis-cli', 'ping']
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|
|
|
|
networks:
|
|
app:
|
|
external: true
|
|
web:
|
|
external: true
|