Spaces:
Sleeping
Sleeping
env
Browse files- Dockerfile +12 -3
Dockerfile
CHANGED
|
@@ -8,9 +8,18 @@ RUN pip install --no-cache --upgrade -r /code/requirements.txt
|
|
| 8 |
# Copy application code and .env file
|
| 9 |
COPY ./backend /code/backend
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
CMD ["uvicorn", "backend.api.app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 8 |
# Copy application code and .env file
|
| 9 |
COPY ./backend /code/backend
|
| 10 |
|
| 11 |
+
# Set up a new user named "user" with user ID 1000
|
| 12 |
+
RUN useradd -m -u 1000 user
|
| 13 |
+
# Switch to the "user" user
|
| 14 |
+
USER user
|
| 15 |
+
# Set home to the user's home directory
|
| 16 |
+
ENV HOME=/home/user \\
|
| 17 |
+
PATH=/home/user/.local/bin:$PATH
|
| 18 |
|
| 19 |
+
# Set the working directory to the user's home directory
|
| 20 |
+
WORKDIR $HOME/app
|
| 21 |
+
|
| 22 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 23 |
+
COPY --chown=user . $HOME/app
|
| 24 |
|
| 25 |
CMD ["uvicorn", "backend.api.app:app", "--host", "0.0.0.0", "--port", "7860"]
|