diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index 7ba64fb..72d0f0a 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -4,6 +4,10 @@ on: push: branches: - main + pull_request: + branches: + - main + workflow_dispatch: jobs: push_to_registry: diff --git a/Dockerfile b/Dockerfile index 93148b9..48c9d84 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /app COPY . /app RUN pip install --no-cache-dir --upgrade pip && \ - pip install --no-cache-dir --user Flask Flask_cors PyYAML openai waitress + pip install --no-cache-dir --user -r requirements.txt # Runtime stage FROM python:3.9-slim as runtime diff --git a/README.md b/README.md index 912366d..d4834cd 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,12 @@ ASK_QUERY=$(sed "s/ /%20/g" <<<"$ASK_QUERY") # encodes whitespaces curl "http://localhost:5003/ask_chat?query=$ASK_QUERY" ``` +## Running with Docker + +1. Install docker on your computer +2. Set the OPENAI_API_KEY in the `docker-compose.yaml` file +3. Execute `docker compose up` + ## Deployment settings Environment variables used in the server: diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..eb69757 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,12 @@ +version: "3" + +services: + app: + build: + context: . + dockerfile: Dockerfile + ports: + - "5003:5003" + environment: + OPENAI_API_KEY: ${OPENAI_API_KEY} + WEB5GPT_MONTHLY_USAGE_LIMIT_USD: 30