From 95ec9c44c6f8f1414c9fb838db8d5594708e40d8 Mon Sep 17 00:00:00 2001 From: Konstantin Nosov Date: Thu, 31 Mar 2022 23:05:30 +0200 Subject: [PATCH 1/5] fix `docker-compose -f complete.yaml up` fix typos --- compose/bots_complete/Dockerfile | 7 ++++--- compose/bots_complete/README.md | 6 +++--- compose/bots_complete/supervisord.conf | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/compose/bots_complete/Dockerfile b/compose/bots_complete/Dockerfile index 42482b03..79a49023 100644 --- a/compose/bots_complete/Dockerfile +++ b/compose/bots_complete/Dockerfile @@ -12,7 +12,7 @@ RUN apt-get install -y python RUN apt-get install -y python-dev RUN apt-get install -y python-distribute RUN apt-get install -y python-pip -RUN pip install --upgrade pip +# RUN pip install --upgrade pip # Copy requirements from source COPY ./etc /requirements @@ -20,10 +20,11 @@ RUN pip install -r /requirements/requirements.txt # Install additional/optional packages RUN pip install suds-jurko==0.6 -RUN pip install paramiko==2.0.2 RUN pip install pycrypto==2.6.1 RUN pip install supervisor==3.3.1 RUN pip install m3-cdecimal==2.3 +RUN pip install psycopg2==2.7.3.2 +RUN pip install paramiko==1.15.2 # Copy complete source COPY . /bots @@ -52,7 +53,7 @@ COPY ./compose/bots_complete/supervisord.conf /etc/supervisor/supervisord.conf # Add Crontab file COPY ./compose/bots_complete/crontab /usr/local/lib/python2.7/dist-packages/bots/config/ -CMD [ /usr/local/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf" ] +CMD [ "/usr/local/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf" ] EXPOSE 8080 EXPOSE 9001 diff --git a/compose/bots_complete/README.md b/compose/bots_complete/README.md index 44d180fd..44f21b04 100644 --- a/compose/bots_complete/README.md +++ b/compose/bots_complete/README.md @@ -3,7 +3,7 @@ ## Introduction This dockerized version should provide a quick installable version of BOTS that runs "out of the box". -The file contains a dockerized version with all optional functionalities activiated in BOTS: +The file contains a dockerized version with all optional functionalities activated in BOTS: 1. Web-Server (default) 2. Directory Monitor @@ -18,11 +18,11 @@ In addition, following tools are used to control the environment: ## Docker Compose File The docker compose file stored at the root of this repo, may be used to create the instance of BOTS by issueing: - docker-composer -f complete.yaml up + docker-compose -f complete.yaml up Docker will then build BOTS based on Ubuntu 16:04 and Python 2.7. -Supervisor's http log-in can be passwort protected through environment variables, here defined as SUPERVUSER and SUPERVPASS. +Supervisor's http log-in can be password protected through environment variables, here defined as SUPERVUSER and SUPERVPASS. Port 8080 is used to provide BOTS Web interface Port 9001 is used for Supervisor HTTP interface diff --git a/compose/bots_complete/supervisord.conf b/compose/bots_complete/supervisord.conf index faaa01e6..2a1fedc6 100644 --- a/compose/bots_complete/supervisord.conf +++ b/compose/bots_complete/supervisord.conf @@ -33,4 +33,4 @@ password = %(ENV_SUPERVPASS)s [unix_http_server] file = /tmp/supervisor.sock -chmod = 0777 \ No newline at end of file +chmod = 0777 From 1548fcb9b03697439114324aacd233b4eff1d115 Mon Sep 17 00:00:00 2001 From: Konstantin Nosov Date: Sun, 3 Apr 2022 00:47:37 +0200 Subject: [PATCH 2/5] add pg container --- .gitignore | 1 + complete.yaml | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/.gitignore b/.gitignore index fb6ee48d..dab042e7 100644 --- a/.gitignore +++ b/.gitignore @@ -107,3 +107,4 @@ coverage.xml # virtualenv venv/ ENV/ +pgdata diff --git a/complete.yaml b/complete.yaml index 81fc43c0..80c3922f 100644 --- a/complete.yaml +++ b/complete.yaml @@ -17,3 +17,13 @@ services: - SUPERVUSER=bots - SUPERVPASS=botsbots command: /usr/local/bin/supervisord -c /etc/supervisor/supervisord.conf + db: + image: postgres + restart: always + volumes: + - ./pgdata:/var/lib/postgresql/data + environment: + POSTGRES_PASSWORD: botsbots + POSTGRES_USER: bots + POSTGRES_DB: botsdb + From 17ea1ad149e02457f3612ae285280807e3988ba7 Mon Sep 17 00:00:00 2001 From: Konstantin Nosov Date: Sun, 3 Apr 2022 00:48:00 +0200 Subject: [PATCH 3/5] use sqllite --- src/bots/config/settings.py | 14 +++++++------- src/bots/install/settings.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/bots/config/settings.py b/src/bots/config/settings.py index eb4f5903..f588052f 100644 --- a/src/bots/config/settings.py +++ b/src/bots/config/settings.py @@ -46,13 +46,13 @@ #~ #PostgreSQL: DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'botsdb', - 'USER': 'bots', - 'PASSWORD': 'botsbots', - 'HOST': '127.0.0.1', - 'PORT': '5432', - 'OPTIONS': {}, + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(PROJECT_PATH, 'botssys/sqlitedb/botsdb'), + 'USER': '', #not needed for SQLite + 'PASSWORD': '', #not needed for SQLite + 'HOST': '', #not needed for SQLite + 'PORT': '', #not needed for SQLite + 'OPTIONS': {}, #not needed for SQLite } } diff --git a/src/bots/install/settings.py b/src/bots/install/settings.py index bdcd447e..8cf653b3 100644 --- a/src/bots/install/settings.py +++ b/src/bots/install/settings.py @@ -49,7 +49,7 @@ #~ 'NAME': 'botsdb', #~ 'USER': 'bots', #~ 'PASSWORD': 'botsbots', - #~ 'HOST': '127.0.0.1', + #~ 'HOST': 'db', #~ 'PORT': '5432', #~ 'OPTIONS': {}, #~ } From 7c11282df70e77974e46716e1ebc8d4a17f56a11 Mon Sep 17 00:00:00 2001 From: Konstantin Nosov Date: Sun, 3 Apr 2022 00:48:11 +0200 Subject: [PATCH 4/5] Revert "add pg container" This reverts commit 1548fcb9b03697439114324aacd233b4eff1d115. --- .gitignore | 1 - complete.yaml | 10 ---------- 2 files changed, 11 deletions(-) diff --git a/.gitignore b/.gitignore index dab042e7..fb6ee48d 100644 --- a/.gitignore +++ b/.gitignore @@ -107,4 +107,3 @@ coverage.xml # virtualenv venv/ ENV/ -pgdata diff --git a/complete.yaml b/complete.yaml index 80c3922f..81fc43c0 100644 --- a/complete.yaml +++ b/complete.yaml @@ -17,13 +17,3 @@ services: - SUPERVUSER=bots - SUPERVPASS=botsbots command: /usr/local/bin/supervisord -c /etc/supervisor/supervisord.conf - db: - image: postgres - restart: always - volumes: - - ./pgdata:/var/lib/postgresql/data - environment: - POSTGRES_PASSWORD: botsbots - POSTGRES_USER: bots - POSTGRES_DB: botsdb - From e7fe63f2625c07cb1ebe54035f9073b029fec8eb Mon Sep 17 00:00:00 2001 From: Konstantin Nosov Date: Sun, 3 Apr 2022 00:55:13 +0200 Subject: [PATCH 5/5] pg dep not needed anymore --- compose/bots_complete/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/compose/bots_complete/Dockerfile b/compose/bots_complete/Dockerfile index 79a49023..f164099d 100644 --- a/compose/bots_complete/Dockerfile +++ b/compose/bots_complete/Dockerfile @@ -23,7 +23,6 @@ RUN pip install suds-jurko==0.6 RUN pip install pycrypto==2.6.1 RUN pip install supervisor==3.3.1 RUN pip install m3-cdecimal==2.3 -RUN pip install psycopg2==2.7.3.2 RUN pip install paramiko==1.15.2 # Copy complete source