rajsecrets0 commited on
Commit
8c6af9b
·
verified ·
1 Parent(s): bbf5033

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -1
Dockerfile CHANGED
@@ -1,14 +1,28 @@
1
  FROM python:3.9-slim
2
 
3
  WORKDIR /app
 
 
4
  COPY . /app
5
 
 
6
  RUN apt-get update && apt-get install -y \
7
  tesseract-ocr \
8
  libtesseract-dev \
9
  && rm -rf /var/lib/apt/lists/*
10
 
 
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
 
 
 
 
 
 
 
 
13
  EXPOSE 7860
14
- CMD ["python", "app.py"]
 
 
 
1
  FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
+
5
+ # Copy all files
6
  COPY . /app
7
 
8
+ # Install system dependencies
9
  RUN apt-get update && apt-get install -y \
10
  tesseract-ocr \
11
  libtesseract-dev \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # Install Python dependencies
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
+ # Set permissions for /app directory
18
+ RUN mkdir -p /app/.files && chown -R 1000:1000 /app
19
+
20
+ # Create a non-root user
21
+ RUN useradd -u 1000 -m myuser
22
+ USER myuser
23
+
24
+ # Expose port 7860
25
  EXPOSE 7860
26
+
27
+ # Run the app
28
+ CMD ["chainlit", "run", "app.py", "--port", "7860"]