File size: 787 Bytes
a78863a
 
 
e705ada
 
 
 
53e32f0
f75b0eb
 
 
53e32f0
 
 
98334be
a78863a
f75b0eb
 
98334be
 
 
 
a78863a
f75b0eb
 
a78863a
 
53e32f0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Use the official Python 3.10.9 image
FROM python:3.10.9

# Install wkhtmltopdf and its dependencies
RUN apt-get update && apt-get install -y \
    wkhtmltopdf \
    && rm -rf /var/lib/apt/lists/*

# Set the working directory
WORKDIR /app

# Create a temporary folder with write permissions
RUN mkdir /app/temp && chmod 777 /app/temp

COPY requirements.txt .

# Install requirements
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy the current directory contents into the container

COPY . .


# Ensure the correct permissions for hrequests library path
RUN chmod -R a+w /usr/local/lib/python3.10/site-packages/hrequests/bin/

# Start the FastAPI app on port 7860, the default port expected by Spaces
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]