File size: 952 Bytes
47a414b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b3a5fbb
47a414b
 
 
 
 
 
 
 
 
 
 
 
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
# Use the official Python image as the base image
FROM python:3.10

# Set the working directory in the container
WORKDIR /app

# Create a non-root user
RUN useradd -ms /bin/bash myuser

# Give the user ownership of the working directory and home directory
RUN chown -R myuser:myuser /app /home/myuser

# Switch to the non-root user
USER myuser

# Copy the entire contents of the local directory into the container
COPY . .

# Download the model file
RUN wget https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGML/resolve/main/llama-2-7b-chat.ggmlv3.q8_0.bin

# Install chainlit and add it to PATH
RUN pip install chainlit==0.6.1 --user

# Set the PATH to include user-specific binaries
ENV PATH="/home/myuser/.local/bin:${PATH}"

# Install the required Python packages
RUN pip install -r requirements.txt

# Expose port 7860 internally in the container
EXPOSE 7860

# Run the ChainlIt command
CMD ["chainlit", "run", "model.py", "-w", "--port", "7860"]