Spaces:
Sleeping
Sleeping
env
Browse files- Dockerfile +10 -6
Dockerfile
CHANGED
|
@@ -5,21 +5,25 @@ WORKDIR /code
|
|
| 5 |
COPY ./requirements.txt /code/requirements.txt
|
| 6 |
RUN pip install --no-cache --upgrade -r /code/requirements.txt
|
| 7 |
|
| 8 |
-
# Copy application code
|
| 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 |
-
|
| 16 |
-
|
| 17 |
-
|
| 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"]
|
|
|
|
|
|
| 5 |
COPY ./requirements.txt /code/requirements.txt
|
| 6 |
RUN pip install --no-cache --upgrade -r /code/requirements.txt
|
| 7 |
|
| 8 |
+
# Copy application code
|
| 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 |
+
|
| 14 |
# Switch to the "user" user
|
| 15 |
USER user
|
| 16 |
+
|
| 17 |
+
# Corrected: Define environment variables separately
|
| 18 |
+
ENV HOME=/home/user
|
| 19 |
+
ENV 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 |
+
# Start the application
|
| 28 |
CMD ["uvicorn", "backend.api.app:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 29 |
+
|