@@ -6,12 +6,12 @@ services:
|
|||||||
worker:
|
worker:
|
||||||
image: mathwave/sprint-repo:ruz-bot
|
image: mathwave/sprint-repo:ruz-bot
|
||||||
environment:
|
environment:
|
||||||
MONGO_HOST: "mongo.dev.chocomarsh.com"
|
|
||||||
STAGE: "development"
|
STAGE: "development"
|
||||||
MONGO_PASSWORD: $MONGO_PASSWORD_DEV
|
MONGO_PASSWORD: $MONGO_PASSWORD_DEV
|
||||||
networks:
|
networks:
|
||||||
- queues-development
|
- queues-development
|
||||||
- configurator
|
- configurator
|
||||||
|
- mongo-development
|
||||||
command: worker
|
command: worker
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
@@ -24,12 +24,11 @@ services:
|
|||||||
fetch:
|
fetch:
|
||||||
image: mathwave/sprint-repo:ruz-bot
|
image: mathwave/sprint-repo:ruz-bot
|
||||||
environment:
|
environment:
|
||||||
MONGO_HOST: "mongo.dev.chocomarsh.com"
|
|
||||||
STAGE: "development"
|
STAGE: "development"
|
||||||
MONGO_PASSWORD: $MONGO_PASSWORD_DEV
|
MONGO_PASSWORD: $MONGO_PASSWORD_DEV
|
||||||
PLATFORM_SECURITY_TOKEN: $PLATFORM_SECURITY_TOKEN
|
|
||||||
networks:
|
networks:
|
||||||
- queues-development
|
- queues-development
|
||||||
|
- mongo-development
|
||||||
command: fetch
|
command: fetch
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
@@ -42,12 +41,11 @@ services:
|
|||||||
notify:
|
notify:
|
||||||
image: mathwave/sprint-repo:ruz-bot
|
image: mathwave/sprint-repo:ruz-bot
|
||||||
environment:
|
environment:
|
||||||
MONGO_HOST: "mongo.dev.chocomarsh.com"
|
|
||||||
STAGE: "development"
|
STAGE: "development"
|
||||||
MONGO_PASSWORD: $MONGO_PASSWORD_DEV
|
MONGO_PASSWORD: $MONGO_PASSWORD_DEV
|
||||||
PLATFORM_SECURITY_TOKEN: $PLATFORM_SECURITY_TOKEN
|
|
||||||
networks:
|
networks:
|
||||||
- queues-development
|
- queues-development
|
||||||
|
- mongo-development
|
||||||
command: notify
|
command: notify
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
@@ -62,11 +60,10 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- common-infra-nginx-development
|
- common-infra-nginx-development
|
||||||
- queues-development
|
- queues-development
|
||||||
|
- mongo-development
|
||||||
environment:
|
environment:
|
||||||
MONGO_HOST: "mongo.dev.chocomarsh.com"
|
|
||||||
STAGE: "development"
|
STAGE: "development"
|
||||||
MONGO_PASSWORD: $MONGO_PASSWORD_DEV
|
MONGO_PASSWORD: $MONGO_PASSWORD_DEV
|
||||||
PLATFORM_SECURITY_TOKEN: $PLATFORM_SECURITY_TOKEN
|
|
||||||
command: api
|
command: api
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
@@ -83,3 +80,5 @@ networks:
|
|||||||
external: true
|
external: true
|
||||||
configurator:
|
configurator:
|
||||||
external: true
|
external: true
|
||||||
|
mongo-development:
|
||||||
|
external: true
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ services:
|
|||||||
worker:
|
worker:
|
||||||
image: mathwave/sprint-repo:ruz-bot
|
image: mathwave/sprint-repo:ruz-bot
|
||||||
environment:
|
environment:
|
||||||
MONGO_HOST: "mongo.chocomarsh.com"
|
|
||||||
STAGE: "production"
|
STAGE: "production"
|
||||||
MONGO_PASSWORD: $MONGO_PASSWORD_PROD
|
MONGO_PASSWORD: $MONGO_PASSWORD_PROD
|
||||||
networks:
|
networks:
|
||||||
- queues
|
- queues
|
||||||
- configurator
|
- configurator
|
||||||
|
- mongo
|
||||||
command: worker
|
command: worker
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
@@ -24,13 +24,13 @@ services:
|
|||||||
fetch:
|
fetch:
|
||||||
image: mathwave/sprint-repo:ruz-bot
|
image: mathwave/sprint-repo:ruz-bot
|
||||||
environment:
|
environment:
|
||||||
MONGO_HOST: "mongo.chocomarsh.com"
|
|
||||||
STAGE: "production"
|
STAGE: "production"
|
||||||
MONGO_PASSWORD: $MONGO_PASSWORD_PROD
|
MONGO_PASSWORD: $MONGO_PASSWORD_PROD
|
||||||
DEBUG: "false"
|
DEBUG: "false"
|
||||||
networks:
|
networks:
|
||||||
- queues
|
- queues
|
||||||
- configurator
|
- configurator
|
||||||
|
- mongo
|
||||||
command: fetch
|
command: fetch
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
@@ -43,13 +43,13 @@ services:
|
|||||||
notify:
|
notify:
|
||||||
image: mathwave/sprint-repo:ruz-bot
|
image: mathwave/sprint-repo:ruz-bot
|
||||||
environment:
|
environment:
|
||||||
MONGO_HOST: "mongo.chocomarsh.com"
|
|
||||||
STAGE: "production"
|
STAGE: "production"
|
||||||
MONGO_PASSWORD: $MONGO_PASSWORD_PROD
|
MONGO_PASSWORD: $MONGO_PASSWORD_PROD
|
||||||
DEBUG: "false"
|
DEBUG: "false"
|
||||||
networks:
|
networks:
|
||||||
- queues
|
- queues
|
||||||
- configurator
|
- configurator
|
||||||
|
- mongo
|
||||||
command: notify
|
command: notify
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
@@ -64,8 +64,8 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- common-infra-nginx
|
- common-infra-nginx
|
||||||
- configurator
|
- configurator
|
||||||
|
- mongo
|
||||||
environment:
|
environment:
|
||||||
MONGO_HOST: "mongo.chocomarsh.com"
|
|
||||||
STAGE: "production"
|
STAGE: "production"
|
||||||
MONGO_PASSWORD: $MONGO_PASSWORD_PROD
|
MONGO_PASSWORD: $MONGO_PASSWORD_PROD
|
||||||
DEBUG: "false"
|
DEBUG: "false"
|
||||||
@@ -85,3 +85,5 @@ networks:
|
|||||||
external: true
|
external: true
|
||||||
configurator:
|
configurator:
|
||||||
external: true
|
external: true
|
||||||
|
mongo:
|
||||||
|
external: true
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ from helpers import now
|
|||||||
|
|
||||||
class Mongo:
|
class Mongo:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
url = f"mongodb://{settings.MONGO_USER}:{settings.MONGO_PASSWORD}@{settings.MONGO_HOST}:27017/"
|
url = f"mongodb://{settings.MONGO_USER}:{settings.MONGO_PASSWORD}@mongo:27017/"
|
||||||
self.client = pymongo.MongoClient(url)
|
self.client = pymongo.MongoClient(url)
|
||||||
self.database = self.client.get_database("ruz-bot")
|
self.database = self.client.get_database("ruz-bot")
|
||||||
self.users_collection.create_index([
|
self.users_collection.create_index([
|
||||||
|
|||||||
Reference in New Issue
Block a user