Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Docker support #296

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

spacepirate0001
Copy link

Add Docker build to containerize the project.

@spacepirate0001 spacepirate0001 mentioned this pull request May 16, 2023
@psociety
Copy link

psociety commented Jun 28, 2023

Did this work for you?
I believe the standard is Dockerfile not dockerfile
I get several errors:

info  - Linting and checking validity of types...
/usr/share/gpt4-pdf-chatbot-langchain/config/pinecone.ts:6
  throw new Error('Missing Pinecone index name in .env file');
        ^


Error: Missing Pinecone index name in .env file
    at <anonymous> (/usr/share/gpt4-pdf-chatbot-langchain/config/pinecone.ts:6:9)
    at ModuleJob.run (node:internal/modules/esm/module_job:192:25)

ENV vars are set and still doesn't seem to grab them :s

gpt4-pdf  | /bin/sh: next: not found
gpt4-pdf  | error Command failed with exit code 127.
gpt4-pdf  | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
gpt4-pdf  | 2023-06-28T14:28:40: PM2 log: App [yarn --interpreter bash start:0] exited with code [127] via signal [SIGINT]
gpt4-pdf  | 2023-06-28T14:28:40: PM2 log: Script /bin/bash had too many unstable restarts (16). Stopped. "errored"
gpt4-pdf  | 2023-06-28T14:28:41: PM2 log: 0 application online, retry = 3
gpt4-pdf  | 2023-06-28T14:28:43: PM2 log: 0 application online, retry = 2
gpt4-pdf  | 2023-06-28T14:28:45: PM2 log: 0 application online, retry = 1
gpt4-pdf  | 2023-06-28T14:28:48: PM2 log: 0 application online, retry = 0
gpt4-pdf  | 2023-06-28T14:28:48: PM2 log: Stopping app:yarn --interpreter bash start id:0
gpt4-pdf  | 2023-06-28T14:28:48: PM2 error: app=yarn --interpreter bash start id=0 does not have a pid
gpt4-pdf  | 2023-06-28T14:28:48: PM2 log: PM2 successfully stopped

A docker-compose.yml would also make the experience simplier:

version: '3'

services:
  gpt4-pdf:
    container_name: gpt4-pdf
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - 3070:3000
    environment:
      OPENAI_API_KEY: WRITE_YOUR_OPENAI_KEY_HERE
      PINECONE_API_KEY: WRITE_YOUR_PINECONE_API_KEY_HERE
      PINECONE_ENVIRONMENT: WRITE_YOUR_PINECONE_ENV_HERE
      PINECONE_INDEX_NAME: WRITE_YOUR_PINECONE_INDEX_NAME_HERE
    volumes:
      - .:/usr/share/gpt4-pdf-chatbot-langchain

@groovybits
Copy link

I have this running in cloudrun as of a few days ago which may help contribute back to see the setup.

https://github.com/groovybits/gaib/blob/main/Dockerfile
https://github.com/groovybits/gaib/blob/main/cloudbuild.yaml

https://github.com/groovybits/gaib/blob/main/CLOUDRUN.md

I actually saw this one and it helped me quite a bit craft it all to work in Cloudrun nicely. In Vercels it times out for me, although GAIB may be different in that regard than this chatbot GAIB evolved out of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants