From 188ecceec8c09244e2f40ca043dcd602842ce337 Mon Sep 17 00:00:00 2001 From: Karim Tabet Date: Thu, 9 Nov 2023 16:47:09 +0000 Subject: [PATCH] Update Makefile and docker compose to allow for making docker builds and running with compose. Update README to reflect this --- Makefile | 4 ++++ README.md | 9 +++++++++ docker-compose.yaml | 14 ++++++++------ server/Makefile | 4 ---- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 65dc268..1e48550 100644 --- a/Makefile +++ b/Makefile @@ -30,3 +30,7 @@ server_api: test-locally: $(MAKE) -C web_ui test-locally $(MAKE) -C server test-locally + +build-docker: + docker build --tag sidekick-server server/ + docker build --tag sidekick-web-ui web_ui/ diff --git a/README.md b/README.md index cae82a7..8c8ba28 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ - [Running Sidekick](#running-sidekick) - [Prerequisites](#prerequisites) - [Installation](#installation) + - [Quickstart](#quickstart) - [Configuration](#configuration) - [About](#about) - [License](#license) @@ -216,6 +217,14 @@ Go here: [Release notes](docs/release_notes.md) ## Installation +### Quickstart +To get the web-ui and server running as quickly as possible, you can build the Docker images and run them using docker-compose. + +Build the Docker images: `make build-docker` + +Update the JWT_SECRET_KEY, OPENAI_KEY and SQLALCHEMY_DATABASE_URI environment variables in docker-compose.yaml and the run: `docker-compose up -d` + + See the [Local installation guide](docs/local-installation.md) for how to get this up and running. ## Configuration diff --git a/docker-compose.yaml b/docker-compose.yaml index bd0010a..f63e857 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,19 +2,21 @@ version: '3' services: sidekick-web-ui: - image: sidekick/web-ui:latest + image: sidekick-web-ui:latest ports: - - "127.0.0.1:8081:8081" + - "8081:8081" environment: - - REACT_APP_SERVER_URL= + - REACT_APP_SERVER_URL=http://127.0.0.1:8000 restart: always + depends_on: + - sidekick-server sidekick-server: - image: sidekick/server:latest + image: sidekick-server:latest ports: - - "5003:5003" + - "127.0.0.1:8000:80" environment: - OPENAI_API_KEY= - - JWT_SECRET= + - JWT_SECRET_KEY= - SQLALCHEMY_DATABASE_URI= restart: always diff --git a/server/Makefile b/server/Makefile index e184f1b..35fde50 100644 --- a/server/Makefile +++ b/server/Makefile @@ -15,10 +15,6 @@ run-dev-locally: init run-prod-locally: init pipenv run gunicorn -w 4 -b 0.0.0.0:5003 app:app -run-container: - docker run -d -p 5004:5004 --name sidekick-server app \ - docker ps - stop-container: docker stop sidekick-server; \ docker ps