Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Commit

Permalink
Dockerize (#5)
Browse files Browse the repository at this point in the history
* Update docker-image.yml

* Update README.md
  • Loading branch information
justinh-rahb authored Jul 31, 2023
1 parent a8666f0 commit ceddcdb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ name: Docker Image
on:
push:
branches: ['master']
create:

env:
REGISTRY: ghcr.io
IMAGE_NAME: rahb-realtors-association/email-autodrafts
IMAGE_NAME: rahb-realtors-association/email-autodrafts # Replace with your lowercase repository name

jobs:
build-and-push-image:
# The job runs if the event was a push to master or a created tag.
if: github.event_name == 'push' || (github.event_name == 'create' && startsWith(github.ref, 'refs/tags/'))
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -31,6 +34,12 @@ jobs:
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Use the Git reference (branch or tag) as the Docker tag.
tags: |
type=ref,event=tag
type=semver,pattern={{version}}
type=sha,format=long
type=raw,value=latest,enable=${{ github.event_name == 'push' }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@ Email Auto-ReplAI is a Python tool that uses AI to automate drafting responses t
## Running with Docker

To get started, you first need to pull the Docker image from the GitHub Container Registry. You can do this by running the following command in your terminal:
```bash
docker pull ghcr.io/rahb-realtors-association/email-autodrafts:master
```sh
docker pull ghcr.io/rahb-realtors-association/email-autodrafts:latest
```

You need to provide your OpenAI API key and specify whether you want to use a local AI model or the OpenAI API. You also need to bind mount your `settings.json` file into the Docker container.

You can do this by running the following command:
```bash
docker run -e OPENAI_API_KEY=<your_openai_api_key> -e USE_LOCAL=<true_or_false> -v /path/to/your/settings.json:/app/settings.json ghcr.io/rahb-realtors-association/email-autodrafts:master
```sh
docker run -e OPENAI_API_KEY=<your_openai_api_key> -v /path/to/your/settings.json:/app/settings.json -v /path/to/your/credentials.json:/app/credentials.json -v /path/to/your/tocken.pickle:/app/token.pickle ghcr.io/rahb-realtors-association/email-autodrafts:latest
```

Please replace `<your_openai_api_key>` with your actual OpenAI API key, `<true_or_false>` with `true` if you want to use a local AI model or `false` if you want to use the OpenAI API, and `/path/to/your/settings.json` with the actual path to your `settings.json` file on your host system.

With this, the project should be up and running inside a Docker container on your system!
Please replace `<your_openai_api_key>` with your actual OpenAI API key, `/path/to/your/settings.json` with the actual path to your `settings.json` file on your host system, and the same for `credentials.json` and `token.pickle`.

## Manual Setup

Expand Down

0 comments on commit ceddcdb

Please sign in to comment.