File size: 701 Bytes
6485a25
 
 
 
 
 
e417257
 
6485a25
e577888
 
 
ffc8eae
6485a25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bae1188
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
FROM python:3.11-slim

# Set the working directory for the container
WORKDIR /usr/src/app

# Copy and install dependencies
COPY requirements.txt ./requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Set cache directories to /tmp
ENV HF_HOME=/tmp/huggingface
ENV TRANSFORMERS_CACHE=/tmp/huggingface

# Set PYTHONPATH to ensure all modules are discoverable
ENV PYTHONPATH=/usr/src/app

# Copy backend files
COPY config.py ./config.py
COPY app/ ./app/
COPY run.py ./run.py

# Copy frontend files
COPY fe/ ./frontend/

# Expose ports for backend and frontend
EXPOSE 8000 7860

# Run both backend and frontend in parallel
CMD ["sh", "-c", "python run.py & python -m frontend.gradio_app"]