Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +9 -12
Dockerfile
CHANGED
@@ -1,23 +1,20 @@
|
|
1 |
-
# Use official Python 3.10 base image
|
2 |
FROM python:3.10
|
3 |
|
4 |
-
# Set the working directory
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
# Copy
|
8 |
COPY requirements.txt .
|
9 |
-
|
10 |
-
# Install dependencies without using cache to reduce image size
|
11 |
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
|
13 |
-
#
|
14 |
-
ENV TRANSFORMERS_CACHE="/app/models_cache"
|
15 |
-
|
16 |
-
# Copy the application code into the container
|
17 |
COPY . .
|
18 |
|
19 |
-
#
|
|
|
|
|
|
|
20 |
EXPOSE 7860
|
21 |
|
22 |
-
#
|
23 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"
|
|
|
|
|
1 |
FROM python:3.10
|
2 |
|
3 |
+
# Set the working directory
|
4 |
WORKDIR /app
|
5 |
|
6 |
+
# Copy and install dependencies
|
7 |
COPY requirements.txt .
|
|
|
|
|
8 |
RUN pip install --no-cache-dir -r requirements.txt
|
9 |
|
10 |
+
# Copy the application code
|
|
|
|
|
|
|
11 |
COPY . .
|
12 |
|
13 |
+
# Ensure the models_cache directory exists and set permissions
|
14 |
+
RUN mkdir -p /app/models_cache && chmod -R 777 /app/models_cache
|
15 |
+
|
16 |
+
# Expose port 7860
|
17 |
EXPOSE 7860
|
18 |
|
19 |
+
# Run the FastAPI application with Uvicorn
|
20 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|