artindnr commited on
Commit
f904e47
·
verified ·
1 Parent(s): de6a03f

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +37 -0
Dockerfile ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Start from a Python base image
2
+ FROM python:3.9
3
+
4
+ # Install necessary packages
5
+ RUN apt-get update && \
6
+ apt-get install -y \
7
+ bash \
8
+ git git-lfs \
9
+ wget curl procps \
10
+ htop vim nano && \
11
+ rm -rf /var/lib/apt/lists/*
12
+
13
+ # Create a new user
14
+ RUN useradd -m -u 1000 user
15
+
16
+ # Set environment variables
17
+ ENV HOME=/home/user \
18
+ PATH=/home/user/.local/bin:$PATH
19
+
20
+ # Set working directory
21
+ WORKDIR /app
22
+
23
+ # Copy the application files
24
+ COPY ./ /app
25
+
26
+ # Change ownership of the application files
27
+ RUN chown -R user:user /app
28
+
29
+ # Switch to the new user
30
+ USER user
31
+
32
+ # Copy and install Python dependencies
33
+ COPY --chown=user:user requirements.txt $HOME/app/requirements.txt
34
+ RUN pip install --no-cache-dir -r $HOME/app/requirements.txt
35
+
36
+ # Set the command to run the application
37
+ CMD ["chainlit", "run", "chain_app.py", "-w", "--port", "7860" ,"-h"]