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

Docker Support #367

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ PINECONE_INDEX_NAME=

Once you've verified that the embeddings and content have been successfully added to your Pinecone, you can run the app `npm run dev` to launch the local dev environment, and then type a question in the chat interface.

## Docker with Docker Compose

**Training the Model**
```
docker-compose build train
```

**Running Web**
```
docker-compose build web && docker-compose up web
```

## Troubleshooting

In general, keep an eye out in the `issues` and `discussions` section of this repo for solutions.
Expand Down
25 changes: 25 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
services:
web:
container_name: gpt4pdf_web
build:
context: ./
dockerfile: dockerfile-web
working_dir: /app
restart: unless-stopped
volumes:
- .:/app
- ./docs:/app
ports:
- "3000:3000"
train:
container_name: gpt4pdf_train
build:
context: ./
dockerfile: dockerfile-train
working_dir: /app
restart: unless-stopped
volumes:
- .:/app
- ./docs:/app
ports:
- "3001:3001"
26 changes: 26 additions & 0 deletions dockerfile-train
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From node:20.1.0-alpine3.17

# Create non-root group and user
RUN addgroup -S bot \
&& adduser -D -S -h /var/cache/bot -s /sbin/nologin -G bot --uid 1001 bot


# Add some useful tools
RUN apk add --no-cache bash musl curl && \
npm i -g [email protected]


# Change directory to project directory
WORKDIR /app

ADD . /app
RUN source .env
# Install dependancies
RUN yarn add sharp && yarn install && npm cache clean --force && npm cache verify

# Ingest documents and build Next app
RUN npm run ingest

USER 1001

CMD ["npm", "run", "ingest"]
19 changes: 19 additions & 0 deletions dockerfile-web
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
From node:20.1.0-alpine3.17

# Create non-root group and user
RUN addgroup -S bot \
&& adduser -D -S -h /var/cache/bot -s /sbin/nologin -G bot --uid 1001 bot

# Change directory to project directory
WORKDIR /app

ADD . /app
RUN source .env

RUN npm install -g next
# Install dependancies
RUN yarn install

USER 1001

CMD ["npm", "run", "dev"]
Empty file added docs/.gitkeep
Empty file.