navjotk commited on
Commit
b0013f8
·
verified ·
1 Parent(s): e122e84

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -14
Dockerfile CHANGED
@@ -1,27 +1,27 @@
1
- # Base image
2
- FROM python:3.11-slim
3
-
4
- # Create a new user
5
- RUN useradd -ms /bin/bash chainlituser
6
 
7
  # Set working directory
8
  WORKDIR /app
9
 
 
 
 
 
 
 
10
  # Copy and install dependencies
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
- # Copy app code
15
  COPY . .
16
 
17
- # Give new user ownership
18
- RUN chown -R chainlituser:chainlituser /app
19
-
20
- # Switch to the new user
21
- USER chainlituser
22
-
23
- # Expose the Chainlit port
24
  EXPOSE 8000
25
 
26
- # Start Chainlit
 
 
 
27
  CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "8000"]
 
1
+ # Use stable Python version
2
+ FROM python:3.10
 
 
 
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
+ # Install system dependencies
8
+ RUN apt-get update && apt-get install -y \
9
+ git \
10
+ build-essential \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
  # Copy and install dependencies
14
  COPY requirements.txt .
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
+ # Copy the rest of the code
18
  COPY . .
19
 
20
+ # Expose Chainlit default port
 
 
 
 
 
 
21
  EXPOSE 8000
22
 
23
+ # Create .files directory to prevent Chainlit crash
24
+ RUN mkdir -p /app/.files
25
+
26
+ # Run Chainlit
27
  CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "8000"]