From 8af327e53413504e512d14a74c868293eaeb0c44 Mon Sep 17 00:00:00 2001 From: Levi Trammell Date: Wed, 13 Mar 2024 09:25:39 -0600 Subject: [PATCH 1/4] Add initial docker setup --- Dockerfile | 16 ++++++++++++++++ docker-compose.yml | 13 +++++++++++++ example.env | 1 + 3 files changed, 30 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 example.env diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..19ab549 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM python:3.11 + + +# Set working directory to /app +WORKDIR /app + +ADD ./app /app/app +ADD ./requirements.txt /app/requirements.txt + +RUN pip install --no-cache-dir -r requirements.txt + +RUN mkdir .logs +ADD ./frontend /app/frontend + +CMD ["uvicorn", "--app-dir", "app/", "--host", "0.0.0.0", "--port", "8000", "main:app"] + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..f1a28f2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3' + +services: + funckycall: + build: . + ports: + - 8000:8000 + environment: + - HOST=0.0.0.0 + - PORT=8000 + env_file: + - ./.env + diff --git a/example.env b/example.env new file mode 100644 index 0000000..48032ce --- /dev/null +++ b/example.env @@ -0,0 +1 @@ +GROQ_API_KEY=YOUR_GROQ_KEY From 3b505c6cbcccac9943267ce8672ef9363ebb5176 Mon Sep 17 00:00:00 2001 From: Levi Trammell Date: Wed, 13 Mar 2024 09:29:57 -0600 Subject: [PATCH 2/4] Update documentation to reflect docker changes --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 2930a68..bc60c3f 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,23 @@ To run this proxy locally on your own machine, follow these steps: 6. Run the FastAPI server: ```uvicorn --app-dir app/ main:app --reload``` +## Docker Compose 🐳 +You can also run the proxy with the provided docker-compose.yml + +1. Clone the GitHub repository: +```git clone https://github.com/unclecode/funckycall.git``` + +2. Navigate to the project directory: +```cd funckycall``` + +3. Create a new .env file: +```cp example.env .env``` + +4. Update the new `.env` to use your Groq API token: +```export GROQ_API_KEY=your-api-key``` + +5. Run docker compose : +```docker compose up``` ## Using the Pre-built Server 🌐 For your convenience, I have already set up a server that you can use temporarily. This allows you to quickly start using the proxy without having to run it locally. From 884230f5d450774c5063d766122f193ca708eee2 Mon Sep 17 00:00:00 2001 From: Levi Trammell Date: Wed, 13 Mar 2024 09:40:06 -0600 Subject: [PATCH 3/4] Remove unnecessary environment in docker-compose --- docker-compose.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f1a28f2..3dec3b8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,9 +5,6 @@ services: build: . ports: - 8000:8000 - environment: - - HOST=0.0.0.0 - - PORT=8000 env_file: - ./.env From c9086e9b42dca36d0604be78b6fb9da3d5bb1e21 Mon Sep 17 00:00:00 2001 From: Levi Trammell Date: Wed, 13 Mar 2024 09:42:21 -0600 Subject: [PATCH 4/4] Add export prefix to example.env --- example.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example.env b/example.env index 48032ce..1d6b150 100644 --- a/example.env +++ b/example.env @@ -1 +1 @@ -GROQ_API_KEY=YOUR_GROQ_KEY +export GROQ_API_KEY=YOUR_GROQ_KEY