flokabukie
commited on
Commit
•
7deb8bb
1
Parent(s):
3494105
Update Dockerfile
Browse files- Dockerfile +15 -4
Dockerfile
CHANGED
@@ -4,14 +4,25 @@ FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7
|
|
4 |
# Set working directory
|
5 |
WORKDIR /app
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
# Copy the API files to the container
|
8 |
-
COPY .
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
# Install dependencies
|
11 |
-
RUN pip install --no-cache-dir fastapi pydantic uvicorn scikit-learn joblib pandas numpy
|
12 |
|
13 |
# Expose the API port
|
14 |
-
EXPOSE
|
15 |
|
16 |
# Start the API
|
17 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "
|
|
|
4 |
# Set working directory
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# Create a writable directory for the cache
|
8 |
+
RUN mkdir -p /.cache/huggingface/hub && chmod -R 777 /.cache
|
9 |
+
|
10 |
+
# Set the TRANSFORMERS_CACHE environment variable
|
11 |
+
ENV TRANSFORMERS_CACHE /.cache/huggingface/hub
|
12 |
+
|
13 |
# Copy the API files to the container
|
14 |
+
COPY main.py .
|
15 |
+
COPY gbc.pkl .
|
16 |
+
COPY scaler.pkl .
|
17 |
+
|
18 |
+
# Upgrade pip
|
19 |
+
RUN /usr/local/bin/python -m pip install --upgrade pip
|
20 |
|
21 |
# Install dependencies
|
22 |
+
RUN pip install --no-cache-dir fastapi pydantic uvicorn scikit-learn joblib pandas numpy
|
23 |
|
24 |
# Expose the API port
|
25 |
+
EXPOSE 7860
|
26 |
|
27 |
# Start the API
|
28 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|