pvanand commited on
Commit
5d3f08d
·
verified ·
1 Parent(s): 0029507

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -16
Dockerfile CHANGED
@@ -1,25 +1,21 @@
 
1
  FROM python:3.10.9
2
 
3
- # Set the working directory in the container
 
 
 
 
4
  WORKDIR /app
5
 
6
- # Copy the current directory contents into the container at /app
7
- COPY . /app
8
 
9
- # Run ls to check the contents (for debugging)
10
- RUN ls
11
 
12
- # Install any needed packages specified in requirements.txt
13
- RUN pip install --no-cache-dir -r requirements.txt
14
-
15
- # Create a non-root user
16
- RUN useradd -m myuser
17
-
18
- # Change the owner of the application directory
19
- RUN chown -R myuser:myuser /app
20
-
21
- # Switch to the non-root user
22
- USER myuser
23
 
24
  # Start the FastAPI app on port 7860, the default port expected by Spaces
25
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use the official Python 3.10.9 image
2
  FROM python:3.10.9
3
 
4
+ # Install wkhtmltopdf and its dependencies
5
+ RUN apt-get update && apt-get install -y \
6
+ wkhtmltopdf \
7
+ && rm -rf /var/lib/apt/lists/*
8
+ # Set the working directory
9
  WORKDIR /app
10
 
11
+ # Copy the current directory contents into the container
12
+ COPY . .
13
 
14
+ # Install requirements
15
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
16
 
17
+ # Ensure the correct permissions for hrequests library path
18
+ RUN chmod -R a+w /usr/local/lib/python3.10/site-packages/hrequests/bin/
 
 
 
 
 
 
 
 
 
19
 
20
  # Start the FastAPI app on port 7860, the default port expected by Spaces
21
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]