-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (28 loc) · 1.11 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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
# Make Port accessable
EXPOSE 3000/tcp
# Setting env.Variables
ENV PORT=3000
ENV HOST='localhost'
# ENV OPENAI_API_KEY= <OPENAI_API_KEY>
# ENV PINECONE_API_KEY=<PINECONE_API_KEY>
# ENV PINECONE_ENVIRONMENT=<PINECONE_ENVIRONMENT>
# ENV PINECONE_INDEX_NAME=<PINECONE_INDEX_NAME>
# Add some useful tools
RUN apk add --no-cache bash musl curl && \
npm i -g pm2@5.3.0
# Copy project files to directory path
COPY . /usr/share/gpt4-pdf-chatbot-langchain
# Change directory to project directory
WORKDIR /usr/share/gpt4-pdf-chatbot-langchain
# Install dependancies
RUN yarn add sharp && yarn install && \
# workaround for Nextjs cache folder issue https://github.com/vercel/next.js/issues/10111
mkdir -p /usr/share/gpt4-pdf-chatbot-langchain/.next/cache/images && chmod -R 777 /usr/share/gpt4-pdf-chatbot-langchain/.next/cache/images
# Ingest documents and build Next app
RUN npm run build
USER 1001
CMD ["pm2-runtime", "start", "yarn --interpreter bash start"]