Spaces:
No application file
No application file
Update DockerFile
Browse files- DockerFile +33 -33
DockerFile
CHANGED
|
@@ -1,33 +1,33 @@
|
|
| 1 |
-
## Use the official Python 3.11 image
|
| 2 |
-
FROM python:3.10
|
| 3 |
-
|
| 4 |
-
# set the working directory in the container
|
| 5 |
-
WORKDIR /app
|
| 6 |
-
|
| 7 |
-
## Copy the current directory contents into the container at /code
|
| 8 |
-
COPY --chown=user ./requirements.txt requirements.txt
|
| 9 |
-
|
| 10 |
-
## Install any needed packages specified in requirements.txt
|
| 11 |
-
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 12 |
-
|
| 13 |
-
# Set up the new user named "user"
|
| 14 |
-
RUN useradd user
|
| 15 |
-
|
| 16 |
-
# Switch to the "user" user
|
| 17 |
-
USER user
|
| 18 |
-
|
| 19 |
-
# Set home to the user's home directory
|
| 20 |
-
ENV HOME=/home/user \
|
| 21 |
-
PATH=/home/user/.local/bin:$PATH
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
# Set the working directory to the user's home directory
|
| 25 |
-
WORKDIR $HOME/app
|
| 26 |
-
|
| 27 |
-
# Copy the current directory contents into the container at /home/user/app
|
| 28 |
-
COPY --chown=user . $HOME/app
|
| 29 |
-
|
| 30 |
-
# Start the FASTAPI App on port 7860
|
| 31 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 32 |
-
|
| 33 |
-
|
|
|
|
| 1 |
+
## Use the official Python 3.11 image
|
| 2 |
+
FROM python:3.10
|
| 3 |
+
|
| 4 |
+
# set the working directory in the container
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
## Copy the current directory contents into the container at /code
|
| 8 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
| 9 |
+
|
| 10 |
+
## Install any needed packages specified in requirements.txt
|
| 11 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 12 |
+
|
| 13 |
+
# Set up the new user named "user"
|
| 14 |
+
RUN useradd user
|
| 15 |
+
|
| 16 |
+
# Switch to the "user" user
|
| 17 |
+
USER user
|
| 18 |
+
|
| 19 |
+
# Set home to the user's home directory
|
| 20 |
+
ENV HOME=/home/user \
|
| 21 |
+
PATH=/home/user/.local/bin:$PATH
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
# Set the working directory to the user's home directory
|
| 25 |
+
WORKDIR $HOME/app
|
| 26 |
+
|
| 27 |
+
# Copy the current directory contents into the container at /home/user/app
|
| 28 |
+
COPY --chown=user . $HOME/app
|
| 29 |
+
|
| 30 |
+
# Start the FASTAPI App on port 7860
|
| 31 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 32 |
+
|
| 33 |
+
|