Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +24 -0
Dockerfile
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.10
|
2 |
+
|
3 |
+
# Set working directory
|
4 |
+
WORKDIR /app
|
5 |
+
|
6 |
+
# Copy project files
|
7 |
+
COPY . /app
|
8 |
+
|
9 |
+
# Install dependencies
|
10 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
11 |
+
|
12 |
+
# Create and set the cache directory for Hugging Face
|
13 |
+
ENV TRANSFORMERS_CACHE="/app/cache"
|
14 |
+
|
15 |
+
# Ensure the cache directory exists and has the correct permissions
|
16 |
+
RUN mkdir -p /app/cache && chmod -R 777 /app/cache
|
17 |
+
|
18 |
+
# Expose the port that the app will run on
|
19 |
+
EXPOSE 7860
|
20 |
+
|
21 |
+
# Command to run the FastAPI app with Uvicorn
|
22 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
23 |
+
|
24 |
+
|