rajsecrets0 commited on
Commit
0e6eea9
·
verified ·
1 Parent(s): 2bff716

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -5
Dockerfile CHANGED
@@ -7,19 +7,23 @@ WORKDIR /app
7
  # Copy the current directory contents into the container at /app
8
  COPY . /app
9
 
10
- # Install any needed packages specified in requirements.txt
11
- RUN pip install --no-cache-dir -r requirements.txt
12
-
13
- # Install additional system dependencies
14
  RUN apt-get update && apt-get install -y \
15
  tesseract-ocr \
16
  libtesseract-dev \
17
  && rm -rf /var/lib/apt/lists/*
18
 
 
 
 
 
 
 
 
19
  # Make port 7860 available to the world outside this container
20
  EXPOSE 7860
21
 
22
- # Define environment variable
23
  ENV GEMINI_API_KEY=${GEMINI_API_KEY}
24
  ENV SERP_API_KEY=${SERP_API_KEY}
25
 
 
7
  # Copy the current directory contents into the container at /app
8
  COPY . /app
9
 
10
+ # Install system dependencies
 
 
 
11
  RUN apt-get update && apt-get install -y \
12
  tesseract-ocr \
13
  libtesseract-dev \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
+ # Install Python dependencies
17
+ RUN pip install --no-cache-dir -r requirements.txt
18
+
19
+ # Create a non-root user and give permissions to /app
20
+ RUN useradd -m myuser && chown -R myuser:myuser /app
21
+ USER myuser
22
+
23
  # Make port 7860 available to the world outside this container
24
  EXPOSE 7860
25
 
26
+ # Define environment variables
27
  ENV GEMINI_API_KEY=${GEMINI_API_KEY}
28
  ENV SERP_API_KEY=${SERP_API_KEY}
29