diff --git a/Dockerfile b/Dockerfile index 2983cb9..ad6bbaa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM python:3 LABEL maintainer="Alexandr Topilski " COPY . /app +COPY docker/db_config.py /app/app/config/ WORKDIR /app RUN pip install -r requirements.txt diff --git a/app/__init__.py b/app/__init__.py index 25d2f55..66b14ad 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -74,6 +74,7 @@ app, bootstrap, babel, db, mail, login_manager, servers_manager = init_project( 'static', 'config/public_config.py', 'config/config.py', + 'config/db_config.py', 'config/mail_config.py' ) diff --git a/app/config/config.py b/app/config/config.py index 247df97..08af1ad 100644 --- a/app/config/config.py +++ b/app/config/config.py @@ -1,11 +1,3 @@ -MONGO_DBNAME = 'iptv' -MONGO_URI = 'mongodb://localhost:27017/' + MONGO_DBNAME - -MONGODB_SETTINGS = { - 'db': MONGO_DBNAME, - 'host': MONGO_URI -} - SECRET_KEY = '1d4bb560a7644fa48852a92ce52d6e08' SERVER_NAME_FOR_POST = '0.0.0.0:8080' PREFERRED_URL_SCHEME = 'http' diff --git a/app/config/db_config.py b/app/config/db_config.py new file mode 100644 index 0000000..209c71f --- /dev/null +++ b/app/config/db_config.py @@ -0,0 +1,7 @@ +MONGO_DBNAME = 'iptv' +MONGO_URI = 'mongodb://localhost:27017/' + MONGO_DBNAME + +MONGODB_SETTINGS = { + 'db': MONGO_DBNAME, + 'host': MONGO_URI +} diff --git a/docker-compose.yml b/docker-compose.yml index 1561c9c..db2012e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,16 +2,9 @@ version: '2' services: mongodb: image: mongo:latest - container_name: "mongodb" + container_name: mongodb ports: - 27017:27017 - iptv: - image: fastogt/iptv:latest - container_name: iptv - ports: - - 6317:6317 - - 8000:8000 - - 7000:7000 iptv_admin: build: context: ./ @@ -23,6 +16,13 @@ services: command: ./server.py ports: - 8080:8080 + iptv: + image: fastogt/iptv:latest + container_name: iptv + ports: + - 6317:6317 + - 8000:8000 + - 7000:7000 nginx: image: nginx container_name: nginx diff --git a/docker/db_config.py b/docker/db_config.py new file mode 100644 index 0000000..08e16af --- /dev/null +++ b/docker/db_config.py @@ -0,0 +1,7 @@ +MONGO_DBNAME = 'iptv' +MONGO_URI = 'mongodb://mongodb:27017/' + MONGO_DBNAME + +MONGODB_SETTINGS = { + 'db': MONGO_DBNAME, + 'host': MONGO_URI +}