diff --git a/docker-compose.yml b/docker-compose.yml index 82b51af..cabf964 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,6 +4,34 @@ services: build: context: . dockerfile: Dockerfile - command: ["bash", "/app/start.sh"] - restart: on-failure \ No newline at end of file + restart: on-failure + depends_on: + - mongodb + networks: + - streamx-network + + mongodb: + image: mongo:latest + container_name: mongodb-streamx + # ports: + # - "27017:27017" Uncomment if you want to access MongoDB from outside the Docker network (e.g., for development) + volumes: + - mongodb_data:/data/db + environment: + # IMPORTANT: Change these credentials BEFORE going to production! + # Make sure to update MONGO_URI in your config.py to match: + # MONGO_URI = "mongodb://admin:password@mongodb:27017/Stream" + # If you change these values below, update config.py with new credentials + - MONGO_INITDB_ROOT_USERNAME=admin + - MONGO_INITDB_ROOT_PASSWORD=password + networks: + - streamx-network + restart: on-failure + +volumes: + mongodb_data: + +networks: + streamx-network: + driver: bridge \ No newline at end of file diff --git a/sample_config.py b/sample_config.py index 2c0cf05..627f2f2 100644 --- a/sample_config.py +++ b/sample_config.py @@ -1,12 +1,29 @@ -BOT_TOKEN = "" -API_ID = 00000000 -API_HASH = "" -MONGO_URI = "" -DATABASE_NAME = "Stream" -OWNER_ID = 100000000 -SUDO_USERS = [100000000] -SECRET_KEY="" -FIREBASE_CREDENTIALS = "" +# - BOT_TOKEN: Get from @BotFather on Telegram (create a new bot). +# - API_ID & API_HASH: Get from https://my.telegram.org/auth (API Development tools). +# WARNING: Keep these secure! Never share or commit to version control. +BOT_TOKEN = "" # e.g., "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11" +API_ID = 00000000 # e.g., 12345678 +API_HASH = "" # e.g., "abcdef1234567890abcdef1234567890" + +# ============================================================================= +# Database Configuration (MongoDB) +# ============================================================================= +# Uncomment ONE option below based on your setup: + +# Docker Compose (default) +MONGO_URI = "mongodb://admin:password@mongodb:27017/Stream" +# make sure docker-compose.yml has the same username/password and that the streamx-bot service has MONGO_URI in its environment variables + +# MongoDB Atlas Cloud (comment out Docker option if using this) +# MONGO_URI = "mongodb+srv://username:password@cluster0.mongodb.net/Stream?retryWrites=true&w=majority" + +DATABASE_NAME = "Stream" +OWNER_ID = 100000000 # e.g., 123456789 +SUDO_USERS = [100000000] # e.g., [123456789, 987654321] + + +SECRET_KEY = "" # e.g., "your-super-secret-random-key-here" +FIREBASE_CREDENTIALS = "" # e.g., '{"type": "service_account", ...}' # DEBUG DEBUG = False