ZealPyae commited on
Commit
4271345
·
verified ·
1 Parent(s): 5fa70a9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -10
Dockerfile CHANGED
@@ -1,16 +1,35 @@
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
- USER user
8
- ENV PATH="/home/user/.local/bin:$PATH"
9
 
10
- WORKDIR /app
 
 
 
 
 
 
 
 
 
 
11
 
12
- COPY --chown=user ./requirements.txt requirements.txt
13
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
 
15
- COPY --chown=user . /app
 
 
 
 
 
 
 
 
16
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
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
+ # USER user
8
+ # ENV PATH="/home/user/.local/bin:$PATH"
9
 
10
+ # WORKDIR /app
11
+
12
+ # COPY --chown=user ./requirements.txt requirements.txt
13
+ # RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
+
15
+ # COPY --chown=user . /app
16
+ # CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
17
+
18
+ # Use the official lightweight Python image.
19
+ # https://hub.docker.com/_/python
20
+ FROM python:3.8-slim
21
 
22
+ # Allow statements and log messages to immediately appear in the logs
23
+ ENV PYTHONUNBUFFERED=True
24
 
25
+ # Copy requirements.txt and install dependencies
26
+ COPY requirements.txt .
27
+ RUN pip install -r requirements.txt
28
+
29
+ # Copy the rest of the application code
30
+ COPY . /app
31
+ WORKDIR /app
32
+
33
+ # Run the FastAPI app with uvicorn
34
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
35
+