File size: 1,131 Bytes
ff54e53
 
 
06b7c55
 
 
 
 
 
 
 
 
 
 
 
 
 
ff54e53
bad5490
 
 
cdd12a2
bad5490
 
 
 
 
 
8d4d705
ff54e53
2edca35
eba7bcf
1b4864c
5e9e4a4
ff54e53
06b7c55
 
ff54e53
 
975792b
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
40
41
# The builder image, used to build the virtual environment
FROM python:3.9

# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user

# Switch to the "user" user
USER user

# Set home to the user's home directory
ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

# Set the working directory to the user's home directory
WORKDIR $HOME/app


# Install required packages
#RUN pip install openai chainlit python-dotenv vecs nltk deeplake transformers lancedb chromadb langchain
#RUN pip install llama-index
RUN pip install --no-cache-dir \
  "llama-index==0.6" \
  llama-index-llms-openai \
  llama-index-embeddings-openai \
  llama-index-vector-stores-chroma \
  "chromadb>=0.5.0" \
  chainlit>=1.1.0 \
  tiktoken


# Expose the secret SECRET_EXAMPLE at buildtime and use its value as git remote URL

RUN --mount=type=secret,id=open_ai,mode=0444,required=true \
   cat /run/secrets/open_ai > $HOME/app/app.py

# Copy the current directory contents into the container at $HOME/app setting the owner to the user
COPY --chown=user . $HOME/app


CMD ["chainlit", "run", "/home/user/app/app.py","--port=7860"]