Sujal Bhat commited on
Commit
f3e9514
·
1 Parent(s): bb86815

dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -5
Dockerfile CHANGED
@@ -1,11 +1,32 @@
1
  FROM python:3.9
 
 
 
 
 
 
 
 
 
2
  RUN useradd -m -u 1000 user
3
  USER user
4
  ENV HOME=/home/user \
5
  PATH=/home/user/.local/bin:$PATH
 
6
  WORKDIR $HOME/app
7
- COPY --chown=user . $HOME/app
8
- COPY ./requirements.txt ~/app/requirements.txt
9
- RUN pip install -r requirements.txt
10
- COPY . .
11
- CMD ["chainlit", "run", "app.py", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
 
1
  FROM python:3.9
2
+
3
+ # Install system dependencies
4
+ RUN apt-get update && apt-get install -y \
5
+ build-essential \
6
+ curl \
7
+ software-properties-common \
8
+ git \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
  RUN useradd -m -u 1000 user
12
  USER user
13
  ENV HOME=/home/user \
14
  PATH=/home/user/.local/bin:$PATH
15
+
16
  WORKDIR $HOME/app
17
+
18
+ # Copy the requirements file
19
+ COPY --chown=user requirements.txt .
20
+
21
+ # Install Python dependencies
22
+ RUN pip install --upgrade pip && \
23
+ pip install --no-cache-dir -r requirements.txt
24
+
25
+ # Copy the rest of the application
26
+ COPY --chown=user . .
27
+
28
+ # Expose the port the app runs on
29
+ EXPOSE 7860
30
+
31
+ # Command to run the application
32
+ CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]