Turbiling commited on
Commit
60eb5c4
·
verified ·
1 Parent(s): b60534d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -4
Dockerfile CHANGED
@@ -1,13 +1,19 @@
1
  FROM python:3.10-slim
2
 
 
 
 
 
3
  WORKDIR /app
 
4
 
5
- # Install Python dependencies
6
  COPY requirements.txt .
7
  RUN pip install --upgrade pip && pip install -r requirements.txt
8
-
9
- # Copy the app code
10
  COPY . .
11
 
12
- # Expose port and run Chainlit
 
 
 
13
  CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10-slim
2
 
3
+ # Create a non-root user
4
+ RUN useradd -m appuser
5
+
6
+ # Create app directory and give ownership
7
  WORKDIR /app
8
+ RUN mkdir -p /app/.files && chown -R appuser /app
9
 
10
+ # Copy files and install dependencies
11
  COPY requirements.txt .
12
  RUN pip install --upgrade pip && pip install -r requirements.txt
 
 
13
  COPY . .
14
 
15
+ # Switch to non-root user
16
+ USER appuser
17
+
18
+ # Run Chainlit
19
  CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]