Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +19 -3
Dockerfile
CHANGED
|
@@ -5,8 +5,24 @@ FROM python:3.9
|
|
| 5 |
RUN useradd -m -u 1000 user
|
| 6 |
WORKDIR /app
|
| 7 |
|
| 8 |
-
COPY --chown=user ./requirements.txt requirements.txt
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
COPY --chown=user . /app
|
| 12 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 5 |
RUN useradd -m -u 1000 user
|
| 6 |
WORKDIR /app
|
| 7 |
|
| 8 |
+
COPY --chown=user ./requirements.txt /app/requirements.txt
|
| 9 |
+
|
| 10 |
+
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
|
| 11 |
+
|
| 12 |
+
# COPY --chown=user . /app
|
| 13 |
+
|
| 14 |
+
# Switch to the "user" user
|
| 15 |
+
USER user
|
| 16 |
+
|
| 17 |
+
# Set home to the user's home directory
|
| 18 |
+
ENV HOME=/home/user \\
|
| 19 |
+
PATH=/home/user/.local/bin:$PATH
|
| 20 |
+
|
| 21 |
+
# Set the working directory to the user's home directory
|
| 22 |
+
WORKDIR $HOME/app
|
| 23 |
+
|
| 24 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 25 |
+
COPY --chown=user . $HOME/app
|
| 26 |
+
|
| 27 |
|
|
|
|
| 28 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|