PercivalFletcher commited on
Commit
69bbb2a
·
verified ·
1 Parent(s): 942a690

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -7
Dockerfile CHANGED
@@ -3,13 +3,18 @@
3
  # Use an official Python runtime as a parent image
4
  FROM python:3.9
5
 
6
- RUN useradd -m -u 1000 user
7
- USER user
8
 
9
- WORKDIR /app
 
10
 
11
- COPY --chown=user ./requirements.txt requirements.txt
12
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
13
 
14
- COPY --chown=user . /app
15
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
3
  # Use an official Python runtime as a parent image
4
  FROM python:3.9
5
 
6
+ # Set the working directory in the container
7
+ WORKDIR /code
8
 
9
+ # Copy the requirements file into the container
10
+ COPY ./requirements.txt /code/requirements.txt
11
 
12
+ # Install any needed packages specified in requirements.txt
13
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
14
 
15
+ # Copy the main application code into the container
16
+ COPY ./main.py /code/main.py
17
+
18
+ # Command to run the app.
19
+ # Hugging Face Spaces expects the app to run on host 0.0.0.0 and port 7860.
20
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]