Spaces:
Runtime error
Runtime error
Try to run everything as root
Browse files- Dockerfile +31 -8
- entrypoint.sh +1 -1
Dockerfile
CHANGED
|
@@ -9,22 +9,20 @@ RUN apt-get update && apt-get install -y \
|
|
| 9 |
# Install uv - it installs in /root/.local/bin
|
| 10 |
ADD https://astral.sh/uv/install.sh /uv-installer.sh
|
| 11 |
RUN sh /uv-installer.sh && rm /uv-installer.sh
|
| 12 |
-
|
| 13 |
-
|
| 14 |
# Set the home directory and path, need access to uv
|
| 15 |
-
ENV HOME=/home/user \
|
| 16 |
-
|
| 17 |
|
| 18 |
# # NEEDED FOR CHAINLIT IN HUGGING FACE SPACES
|
| 19 |
ENV UVICORN_WS_PROTOCOL=websockets
|
| 20 |
|
| 21 |
# Set the working directory
|
| 22 |
-
WORKDIR
|
| 23 |
|
| 24 |
-
RUN curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR
|
| 25 |
|
| 26 |
# # Copy the app to the container
|
| 27 |
-
COPY
|
| 28 |
|
| 29 |
RUN chmod 777 entrypoint.sh
|
| 30 |
|
|
@@ -33,5 +31,30 @@ RUN uv sync --frozen
|
|
| 33 |
|
| 34 |
# # Expose the ports
|
| 35 |
EXPOSE 7860 6333
|
| 36 |
-
|
| 37 |
ENTRYPOINT ["./entrypoint.sh"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
# Install uv - it installs in /root/.local/bin
|
| 10 |
ADD https://astral.sh/uv/install.sh /uv-installer.sh
|
| 11 |
RUN sh /uv-installer.sh && rm /uv-installer.sh
|
|
|
|
|
|
|
| 12 |
# Set the home directory and path, need access to uv
|
| 13 |
+
# ENV HOME=/home/user \
|
| 14 |
+
# PATH="/home/user/.local/bin:/root/.local/bin/:$PATH"
|
| 15 |
|
| 16 |
# # NEEDED FOR CHAINLIT IN HUGGING FACE SPACES
|
| 17 |
ENV UVICORN_WS_PROTOCOL=websockets
|
| 18 |
|
| 19 |
# Set the working directory
|
| 20 |
+
WORKDIR /app
|
| 21 |
|
| 22 |
+
RUN curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR=/app sh
|
| 23 |
|
| 24 |
# # Copy the app to the container
|
| 25 |
+
COPY . /app
|
| 26 |
|
| 27 |
RUN chmod 777 entrypoint.sh
|
| 28 |
|
|
|
|
| 31 |
|
| 32 |
# # Expose the ports
|
| 33 |
EXPOSE 7860 6333
|
| 34 |
+
|
| 35 |
ENTRYPOINT ["./entrypoint.sh"]
|
| 36 |
+
|
| 37 |
+
# # Set the home directory and path, need access to uv
|
| 38 |
+
# ENV HOME=/home/user \
|
| 39 |
+
# PATH="/home/user/.local/bin:/root/.local/bin/:$PATH"
|
| 40 |
+
|
| 41 |
+
# # # NEEDED FOR CHAINLIT IN HUGGING FACE SPACES
|
| 42 |
+
# ENV UVICORN_WS_PROTOCOL=websockets
|
| 43 |
+
|
| 44 |
+
# # Set the working directory
|
| 45 |
+
# WORKDIR $HOME/app
|
| 46 |
+
|
| 47 |
+
# RUN curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR=$HOME/app sh
|
| 48 |
+
|
| 49 |
+
# # # Copy the app to the container
|
| 50 |
+
# COPY --chown=user . $HOME/app
|
| 51 |
+
|
| 52 |
+
# RUN chmod 777 entrypoint.sh
|
| 53 |
+
|
| 54 |
+
# # # Install the dependencies
|
| 55 |
+
# RUN uv sync --frozen
|
| 56 |
+
|
| 57 |
+
# # # Expose the ports
|
| 58 |
+
# EXPOSE 7860 6333
|
| 59 |
+
# USER root
|
| 60 |
+
# ENTRYPOINT ["./entrypoint.sh"]
|
entrypoint.sh
CHANGED
|
@@ -10,5 +10,5 @@ ls -la
|
|
| 10 |
ls -la ../
|
| 11 |
# Run my chainlit app using uv
|
| 12 |
echo "Starting Chainlit application..."
|
| 13 |
-
|
| 14 |
|
|
|
|
| 10 |
ls -la ../
|
| 11 |
# Run my chainlit app using uv
|
| 12 |
echo "Starting Chainlit application..."
|
| 13 |
+
/app/uv run chainlit run app.py --host 0.0.0.0 --port 7860
|
| 14 |
|