GhylB commited on
Commit
b9b2fde
·
1 Parent(s): 06438cb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -3
Dockerfile CHANGED
@@ -4,8 +4,14 @@ 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 . /app
9
 
10
  # Upgrade pip
11
  RUN /usr/local/bin/python -m pip install --upgrade pip
@@ -14,7 +20,7 @@ RUN /usr/local/bin/python -m pip install --upgrade pip
14
  RUN pip install --no-cache-dir fastapi pydantic uvicorn scikit-learn joblib pandas numpy
15
 
16
  # Expose the API port
17
- EXPOSE 8080
18
 
19
  # Start the API
20
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]
 
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
 
16
  # Upgrade pip
17
  RUN /usr/local/bin/python -m pip install --upgrade pip
 
20
  RUN pip install --no-cache-dir fastapi pydantic uvicorn scikit-learn joblib pandas numpy
21
 
22
  # Expose the API port
23
+ EXPOSE 7860
24
 
25
  # Start the API
26
+ CMD ["uvicorn", "main:app", "--server.address", "0.0.0.0", "--server.port", "7860","--browser.serverAddress","ghylb-sepsis_prediction_app.hf.space","--broswer.serverAddress","0.0.0.0:7860"]