diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..5bb461fa --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,77 @@ +services: + postgres: + image: postgres:15-alpine + container_name: remnawave_bot_db + restart: unless-stopped + environment: + POSTGRES_DB: ${POSTGRES_DB:-remnawave_bot} + POSTGRES_USER: ${POSTGRES_USER:-remnawave_user} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-secure_password_123} + POSTGRES_INITDB_ARGS: "--encoding=UTF8" + volumes: + - postgres_data:/var/lib/postgresql/data + networks: + - bot_network + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-remnawave_user} -d ${POSTGRES_DB:-remnawave_bot}"] + interval: 30s + timeout: 5s + retries: 5 + start_period: 30s + + redis: + image: redis:7-alpine + container_name: remnawave_bot_redis + restart: unless-stopped + command: redis-server --appendonly yes + volumes: + - redis_data:/data + networks: + - bot_network + healthcheck: + test: ["CMD", "redis-cli", "ping"] + interval: 30s + timeout: 10s + retries: 3 + + bot: + image: fr1ngg/remnawave-bedolaga-telegram-bot:latest + container_name: remnawave_bot + restart: unless-stopped + depends_on: + postgres: + condition: service_healthy + redis: + condition: service_healthy + env_file: + - .env + environment: + DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-remnawave_user}:${POSTGRES_PASSWORD:-secure_password_123}@postgres:5432/${POSTGRES_DB:-remnawave_bot} + REDIS_URL: redis://redis:6379/0 + volumes: + - ./logs:/app/logs + - ./data:/app/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + ports: + - "${TRIBUTE_WEBHOOK_PORT:-8081}:8081" + - "${YOOKASSA_WEBHOOK_PORT:-8082}:8082" + networks: + - bot_network + healthcheck: + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8081/health"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 60s + +volumes: + postgres_data: + redis_data: + +networks: + bot_network: + driver: bridge + ipam: + config: + - subnet: 172.20.0.0/16