From 2bd94fed3485ab9521c9dded0b5454ee85163f6d Mon Sep 17 00:00:00 2001 From: Antonio Dejesus Date: Sat, 13 May 2023 10:59:00 -0400 Subject: [PATCH] basic dockerfile with usage --- README.md | 6 ++++++ container.env | 12 ++++++++++++ dockerfile | 20 ++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 container.env create mode 100644 dockerfile diff --git a/README.md b/README.md index 0ed1dfc..8653660 100644 --- a/README.md +++ b/README.md @@ -30,12 +30,18 @@ Useful in a variety of situations where you have too much information to learn a ## Deploying the App +### Digital Ocean Click this button to deploy the app to the DigitalOcean App Platform. If you are not logged in, you will be prompted to log in with your DigitalOcean account. [![Deploy to DigitalOcean](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/squarecat/doc-buddy/tree/main&refcode=1f67a87765d4) When you get to the "Review" section of the deploy, make sure to set the plan to `Basic` as it will default to `Pro`. The chat component should run fine on a $5/mo sized instance, and the memory component will probably be fine at $5 also, but much faster at $10/mo. +### Docker +1. `docker build -t doc-buddy` +2. Fill in container.env file with your keys from the Getting Started section +3. `docker run -p 3000:80 -d doc-buddy --env-file container.env` + ## Environment Variables You'll need to add these to the DigitalOcean app env variables. diff --git a/container.env b/container.env new file mode 100644 index 0000000..fe391f7 --- /dev/null +++ b/container.env @@ -0,0 +1,12 @@ +OPEN_AI_MODEL= +OPEN_AI_KEY= +TELEGRAM_TOKEN= +EMBEDDINGS_BEARER_TOKEN= +STORAGE_NAME= +STORAGE_URL= +STORAGE_KEY= +STORAGE_SECRET= +DATASTORE= +PINECONE_API_KEY= +PINECONE_ENVIRONMENT= +PINECONE_INDEX= \ No newline at end of file diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..010e071 --- /dev/null +++ b/dockerfile @@ -0,0 +1,20 @@ +# Use an official Node.js runtime as a parent image +FROM node:14-alpine + +# Set working directory +WORKDIR /app + +# Copy the package.json and package-lock.json files to the working directory +COPY package*.json ./ + +# Install app dependencies +RUN npm install + +# Copy the rest of the app files to the working directory +COPY . . + +# Expose port 3000 +EXPOSE 3000 + +# Start the app +CMD ["node", "index.js"] \ No newline at end of file