From 7aafac5b5e0817537868e05005f48ca17ed1d712 Mon Sep 17 00:00:00 2001 From: Serj Date: Mon, 24 Apr 2023 18:39:53 +0100 Subject: [PATCH 1/5] Expanded developer start a little bit --- README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9c39c2a8..4aba41d7 100644 --- a/README.md +++ b/README.md @@ -68,13 +68,19 @@ Spin up only 2 containers from docker-compose.yaml (by deleting all services exc Make sure you have python 3.10 or 3.11 installed 1. Navigate to `/application` folder -2. Install dependencies + +2. Install redis server `sudo apt install redis-server` +3. Start redis server `sudo service redis-server start` +4. Export required variables +`export CELERY_BROKER_URL=redis://localhost:6379/0` +`export CELERY_RESULT_BACKEND=redis://localhost:6379/1` +5. Install dependencies `pip install -r requirements.txt` -3. Prepare .env file +6. Prepare .env file Copy .env_sample and create .env with your openai api token -4. Run the app +7. Run the app `python app.py` -5. Start worker with `celery -A app.celery worker -l INFO` +8. Start worker with `celery -A app.celery worker -l INFO` To start frontend 1. Navigate to `/frontend` folder From b6cadb1d65010780650be451e7c21130941f7c81 Mon Sep 17 00:00:00 2001 From: Serj Date: Mon, 24 Apr 2023 18:46:05 +0100 Subject: [PATCH 2/5] Removed spaces --- frontend/.env.development | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/.env.development b/frontend/.env.development index 701f5bac..1b37f204 100644 --- a/frontend/.env.development +++ b/frontend/.env.development @@ -1,2 +1,2 @@ # Please put appropriate value -VITE_API_HOST = http://localhost:5001 \ No newline at end of file +VITE_API_HOST=http://localhost:5001 \ No newline at end of file From 1609b4562dbc8fabf1a143248e18ced17376732a Mon Sep 17 00:00:00 2001 From: Serj Date: Mon, 24 Apr 2023 19:22:42 +0100 Subject: [PATCH 3/5] Added mongo db start --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4aba41d7..23caf226 100644 --- a/README.md +++ b/README.md @@ -71,22 +71,23 @@ Make sure you have python 3.10 or 3.11 installed 2. Install redis server `sudo apt install redis-server` 3. Start redis server `sudo service redis-server start` -4. Export required variables +4. Start mongo DB `sudo docker run -d -p 27017:27017 --name test-mongo mongo:latest` +5. Export required variables `export CELERY_BROKER_URL=redis://localhost:6379/0` `export CELERY_RESULT_BACKEND=redis://localhost:6379/1` -5. Install dependencies +`export MONGO_URI=mongodb://localhost=localhost:27017/docsgpt` +6. Install dependencies `pip install -r requirements.txt` -6. Prepare .env file +7. Prepare .env file Copy .env_sample and create .env with your openai api token -7. Run the app +8. Run the app `python app.py` -8. Start worker with `celery -A app.celery worker -l INFO` +9. Start worker with `celery -A app.celery worker -l INFO` To start frontend 1. Navigate to `/frontend` folder 2. Install dependencies `npm install` -3. In the file `.env.development` instead of `VITE_API_HOST = https://docsapi.arc53.com` use `VITE_API_HOST=http://localhost:5001` 3. Run the app 4. `npm run dev` From 16a540b89b92da0e77eb5f288bf2c99e3f3b506d Mon Sep 17 00:00:00 2001 From: Serj Date: Wed, 26 Apr 2023 18:54:59 +0100 Subject: [PATCH 4/5] Expand readme and added port in wsgi --- README.md | 4 ++-- application/wsgi.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 23caf226..4957231e 100644 --- a/README.md +++ b/README.md @@ -75,13 +75,13 @@ Make sure you have python 3.10 or 3.11 installed 5. Export required variables `export CELERY_BROKER_URL=redis://localhost:6379/0` `export CELERY_RESULT_BACKEND=redis://localhost:6379/1` -`export MONGO_URI=mongodb://localhost=localhost:27017/docsgpt` +`export MONGO_URI=mongodb://localhost:27017/docsgpt` 6. Install dependencies `pip install -r requirements.txt` 7. Prepare .env file Copy .env_sample and create .env with your openai api token 8. Run the app -`python app.py` +`python wsgi.py` 9. Start worker with `celery -A app.celery worker -l INFO` To start frontend diff --git a/application/wsgi.py b/application/wsgi.py index 11e7de6d..05ee157f 100644 --- a/application/wsgi.py +++ b/application/wsgi.py @@ -1,4 +1,4 @@ from app import app if __name__ == "__main__": - app.run() \ No newline at end of file + app.run(debug=True, port=5001) \ No newline at end of file From bdf67a7db7661832c9e9cda1b6b04c40c1046fe5 Mon Sep 17 00:00:00 2001 From: Serj Date: Wed, 26 Apr 2023 19:05:50 +0100 Subject: [PATCH 5/5] Added dev docker compose file --- README.md | 15 ++++++--------- docker-compose-dev.yaml | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 docker-compose-dev.yaml diff --git a/README.md b/README.md index 4957231e..bf5a9228 100644 --- a/README.md +++ b/README.md @@ -68,21 +68,18 @@ Spin up only 2 containers from docker-compose.yaml (by deleting all services exc Make sure you have python 3.10 or 3.11 installed 1. Navigate to `/application` folder - -2. Install redis server `sudo apt install redis-server` -3. Start redis server `sudo service redis-server start` -4. Start mongo DB `sudo docker run -d -p 27017:27017 --name test-mongo mongo:latest` -5. Export required variables +2. Run `docker-compose -f docker-compose-dev.yaml build && docker-compose -f docker-compose-dev.yaml up -d` +3. Export required variables `export CELERY_BROKER_URL=redis://localhost:6379/0` `export CELERY_RESULT_BACKEND=redis://localhost:6379/1` `export MONGO_URI=mongodb://localhost:27017/docsgpt` -6. Install dependencies +4. Install dependencies `pip install -r requirements.txt` -7. Prepare .env file +5. Prepare .env file Copy .env_sample and create .env with your openai api token -8. Run the app +6. Run the app `python wsgi.py` -9. Start worker with `celery -A app.celery worker -l INFO` +7. Start worker with `celery -A app.celery worker -l INFO` To start frontend 1. Navigate to `/frontend` folder diff --git a/docker-compose-dev.yaml b/docker-compose-dev.yaml new file mode 100644 index 00000000..f68e4e07 --- /dev/null +++ b/docker-compose-dev.yaml @@ -0,0 +1,20 @@ +version: "3.9" + +services: + + redis: + image: redis:6-alpine + ports: + - 6379:6379 + + mongo: + image: mongo:6 + ports: + - 27017:27017 + volumes: + - mongodb_data_container:/data/db + + + +volumes: + mongodb_data_container: \ No newline at end of file