56 lines
1.5 KiB
YAML
56 lines
1.5 KiB
YAML
version: '3'
|
|
services:
|
|
redis_telegram_bot:
|
|
image: redis
|
|
container_name: redis_telegram_bot
|
|
ports:
|
|
- "6379:6379"
|
|
volumes:
|
|
- ./volumes/redis/data:/data
|
|
environment:
|
|
- REDIS_REPLICATION_MODE=master
|
|
restart: always
|
|
command: "redis-server --appendonly yes --replica-read-only no"
|
|
|
|
postgres_telegram_bot:
|
|
image: postgres:12-alpine
|
|
container_name: postgres_telegram_bot
|
|
ports:
|
|
- 5433:5432
|
|
volumes:
|
|
- ./volumes/postgres/pgdata:/var/lib/postgresql/data/pgdata
|
|
restart: always
|
|
environment:
|
|
- POSTGRES_DB=postgresdb
|
|
- POSTGRES_USER=admin
|
|
- POSTGRES_PASSWORD=admin
|
|
- PGDATA=/var/lib/postgresql/data/pgdata
|
|
- POSTGRES_HOST_AUTH_METHOD=trust
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: '2'
|
|
memory: '1g'
|
|
|
|
telegram_bot:
|
|
image: telegram_bot
|
|
container_name: telegram_bot
|
|
env_file:
|
|
- .env
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
working_dir: /app
|
|
depends_on:
|
|
- redis_telegram_bot
|
|
- postgres_telegram_bot
|
|
links:
|
|
- redis_telegram_bot
|
|
- postgres_telegram_bot
|
|
volumes:
|
|
- ./app:/app
|
|
- ./volumes/logs:/volumes/logs
|
|
ports:
|
|
- 8000:8000
|
|
restart: always
|
|
command: python main.py |