Turbiling commited on
Commit
e613562
·
verified ·
1 Parent(s): f9cb9bf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -10
Dockerfile CHANGED
@@ -1,23 +1,24 @@
1
  FROM python:3.10-slim
2
 
3
- WORKDIR /app
 
4
 
5
- # Install necessary system packages
6
  RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
7
 
8
- # ✅ Create both Chainlit directories and set permissions
9
- RUN mkdir -p /app/.chainlit && chmod -R 777 /app/.chainlit
10
- RUN mkdir -p /app/.files && chmod -R 777 /app/.files
11
 
12
- # Copy requirements and install
13
  COPY requirements.txt .
14
  RUN pip install --upgrade pip && pip install -r requirements.txt
15
 
16
- # Copy the rest of the app
17
  COPY . .
18
 
19
- # ✅ Set environment variable (good practice, though optional)
20
- ENV CHAINLIT_STORAGE_DIR=/app/.chainlit
 
21
 
22
- # Run the Chainlit app
23
  CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10-slim
2
 
3
+ # Set working directory
4
+ WORKDIR /workspace
5
 
6
+ # Install system packages
7
  RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
8
 
9
+ # ✅ Create writable directories for Chainlit
10
+ RUN mkdir -p /workspace/.files /workspace/.chainlit && chmod -R 777 /workspace
 
11
 
12
+ # Copy requirements and install dependencies
13
  COPY requirements.txt .
14
  RUN pip install --upgrade pip && pip install -r requirements.txt
15
 
16
+ # Copy app code
17
  COPY . .
18
 
19
+ # ✅ Set environment variables to writable paths
20
+ ENV CHAINLIT_PROJECT_ROOT=/workspace
21
+ ENV CHAINLIT_STORAGE_DIR=/workspace/.chainlit
22
 
23
+ # ✅ Default CMD to run Chainlit app
24
  CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]