diff --git a/config/ config_example.json b/config/ config_example.json deleted file mode 100644 index e78d0de..0000000 --- a/config/ config_example.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "mongodb":{ - "mongodb_username":"mongodb_username", - "mongodb_password":"mongodb_password", - "mongodb_uri":"mongodb_uri", - "database_name":"database_name" - }, - "postgreSQL":{ - "username":"username", - "password_DB":"password_DB" - }, - "subscription_templates":{ - "Бимжик":{ - "duration":1, - "iplimit":2, - "cost":200 - }, - "Бизнес_хомячёк":{ - "duration":3, - "iplimit":2, - "cost":500 - }, - "Продвинутый_Акулёнок":{ - "duration":12, - "iplimit":2, - "cost":888 - } - }, - "token":"token" -} \ No newline at end of file diff --git a/docker-compose-example.yml b/docker-compose-example.yml new file mode 100644 index 0000000..6719892 --- /dev/null +++ b/docker-compose-example.yml @@ -0,0 +1,56 @@ +networks: + bot_network: + driver: bridge + +volumes: + mongo_data: + postgres_data: + logs_data: + +services: + mongodb: + networks: + - bot_network + image: mongo:latest + container_name: mongodb + ports: + - "27017:27017" + environment: + MONGO_INITDB_ROOT_USERNAME: USERNAME + MONGO_INITDB_ROOT_PASSWORD: PASSWORD + volumes: + - mongo_data:/data/db + + postgres: + networks: + - bot_network + image: postgres:latest + container_name: postgres + ports: + - "5432:5432" + environment: + POSTGRES_USER: USER + POSTGRES_PASSWORD: PASSWORD + POSTGRES_DB: DB_NAME + volumes: + - postgres_data:/var/lib/postgresql/data + + bot: + networks: + - bot_network + build: + context: . + container_name: telegram_bot + environment: + TOKEN: "TOKEN" + POSTGRES_URL: "postgresql://USER:PASSWORD@postgres:5432/DB_NAME" + MONGO_URL: "mongodb://USERNAME:PASSWORD@mongodb:27017" + DB_NAME: "MONGO_DB_NAME" + SERVER_COLLECTION: "COLLECTION IN MONGO DB " + PLAN_COLLECTION: "COLLECTION IN MONGO DB" + volumes: + - logs_data:/app/logs + depends_on: + - postgres + - mongodb + command: ["python", "main.py"]