Spaces:
Runtime error
Runtime error
Neupane9Sujal
commited on
Update Dockerfile
Browse files- Dockerfile +11 -17
Dockerfile
CHANGED
@@ -1,25 +1,19 @@
|
|
1 |
FROM python:3.9
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
## copy the current directory contents into the container
|
7 |
-
COPY ./requirements.txt /code/requirements.txt
|
8 |
-
|
9 |
-
## install the required packages
|
10 |
-
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
11 |
-
|
12 |
-
##Setup a new user named named "user"
|
13 |
-
RUN useradd user
|
14 |
|
15 |
-
|
16 |
-
|
17 |
|
18 |
-
|
19 |
-
|
20 |
|
21 |
-
|
|
|
22 |
|
23 |
-
|
|
|
24 |
|
|
|
25 |
CMD["uvicorn","app:app","--host","0.0.0.0", "--port", "8000"]
|
|
|
1 |
FROM python:3.9
|
2 |
|
3 |
+
# Use a base image with Python installed
|
4 |
+
FROM python:3.9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
+
# WORKDIR - sets the working directory for any RUN, CMD, ENTRYPOINT, COPY and ADD instructions that follow it in the Dockerfile.
|
7 |
+
WORKDIR /service
|
8 |
|
9 |
+
# Copy the requirements file to the container
|
10 |
+
COPY requirements.txt .
|
11 |
|
12 |
+
#COPY - copies files or directories and adds them to the filesystem of the container.
|
13 |
+
COPY . ./
|
14 |
|
15 |
+
# Install the required packages
|
16 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
|
18 |
+
# Set the command to run when the container starts
|
19 |
CMD["uvicorn","app:app","--host","0.0.0.0", "--port", "8000"]
|