File size: 887 Bytes
ec18d9b
 
 
 
 
 
 
 
 
 
09148b8
ec18d9b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
29
30
31
# Use official Python runtime as a parent image
FROM python:3.10-slim

# Set the working directory to /code
WORKDIR /code

# Set permissions for local cache (useful for Hugging Face Spaces)
RUN mkdir -p /code/cache && chmod -R 777 /code/cache
ENV TRANSFORMERS_CACHE=/code/cache
ENV HF_HOME=/code/cache
ENV PYTHONPATH=/code

# Copy the requirements file into the container
COPY ./requirements.txt /code/requirements.txt

# Install dependencies
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

# Copy the rest of the application code
COPY . /code

# Create necessary directories for the app
RUN mkdir -p /code/pdfs_demystify /code/video_consents
RUN chmod -R 777 /code/pdfs_demystify /code/video_consents

# Expose port 7860 (Hugging Face Spaces default)
EXPOSE 7860

# Run the FastAPI app with Uvicorn
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]