File size: 550 Bytes
e72f849
 
 
 
 
d41e2a7
 
 
 
 
 
e72f849
 
 
 
 
 
 
cc30d43
b1fa1fc
cc30d43
d2a5d22
 
 
 
e72f849
d2a5d22
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
FROM python:3.10-slim

# Set working directory
WORKDIR /code

# Create HF cache directory with write permissions
RUN mkdir -p /code/cache && chmod -R 777 /code/cache

# Set environment variables
ENV TRANSFORMERS_CACHE=/code/cache

# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy app code
COPY app /code/app

# Copy model
COPY ./bert-model /code/./bert-model

# Expose the port used by FastAPI
EXPOSE 7860

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