Ahmed007 commited on
Commit
981d587
1 Parent(s): 4f87d63

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -3
Dockerfile CHANGED
@@ -1,16 +1,25 @@
1
- # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
- # you will also find guides on how best to write your Dockerfile
3
-
4
  FROM python:3.9
5
 
 
6
  RUN useradd -m -u 1000 user
7
 
 
8
  WORKDIR /app
9
 
 
10
  COPY --chown=user ./requirements.txt requirements.txt
11
 
 
12
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
13
 
 
 
 
 
 
 
 
14
  COPY --chown=user . /app
15
 
 
16
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
1
  FROM python:3.9
2
 
3
+ # Create a new user 'user' with user id 1000
4
  RUN useradd -m -u 1000 user
5
 
6
+ # Set the working directory to /app
7
  WORKDIR /app
8
 
9
+ # Copy the requirements.txt file into the container at /app/requirements.txt
10
  COPY --chown=user ./requirements.txt requirements.txt
11
 
12
+ # Install the Python dependencies from requirements.txt
13
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
 
15
+ # Install wget to ensure the next RUN command works
16
+ RUN apt-get update && apt-get install -y wget && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Download the model file using wget
19
+ RUN wget https://huggingface.co/Ahmed007/chest_xray/resolve/main/model.h5 -O model.h5 && chown user:user model.h5
20
+
21
+ # Copy the current directory into the container at /app
22
  COPY --chown=user . /app
23
 
24
+ # Command to run the application
25
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]