Spaces:
Runtime error
Runtime error
ssss
Browse files- Dockerfile +17 -15
Dockerfile
CHANGED
@@ -1,31 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
2 |
# Get a distribution that has uv already installed
|
3 |
-
FROM ghcr.io/astral-sh/uv:python3.
|
4 |
-
|
5 |
-
# Add user - this is the user that will run the app
|
6 |
# If you do not set user, the app will run as root (undesirable)
|
7 |
RUN useradd -m -u 1000 user
|
8 |
USER user
|
9 |
-
|
10 |
# Set the home directory and path
|
11 |
ENV HOME=/home/user \
|
12 |
-
|
13 |
-
|
14 |
ENV UVICORN_WS_PROTOCOL=websockets
|
15 |
-
|
16 |
-
|
17 |
# Set the working directory
|
18 |
WORKDIR $HOME/app
|
19 |
-
|
20 |
# Copy the app to the container
|
21 |
COPY --chown=user . $HOME/app
|
22 |
-
|
23 |
# Install the dependencies
|
24 |
-
|
25 |
-
RUN uv sync
|
26 |
-
|
27 |
# Expose the port
|
28 |
EXPOSE 7860
|
29 |
-
|
30 |
# Run the app
|
31 |
-
CMD ["uv", "run", "chainlit", "run", "
|
|
|
1 |
+
# FROM python:3.9
|
2 |
+
# RUN useradd -m -u 1000 user
|
3 |
+
# USER user
|
4 |
+
# ENV HOME=/home/user \
|
5 |
+
# PATH=/home/user/.local/bin:$PATH
|
6 |
+
# WORKDIR $HOME/app
|
7 |
+
# COPY --chown=user . $HOME/app
|
8 |
+
# COPY ./requirements.txt ~/app/requirements.txt
|
9 |
+
# RUN pip install -r requirements.txt
|
10 |
+
# COPY . .
|
11 |
+
# CMD ["chainlit", "run", "app.py", "--port", "7860"]
|
12 |
|
13 |
# Get a distribution that has uv already installed
|
14 |
+
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
|
15 |
+
# Add user-this is the user that will run the app
|
|
|
16 |
# If you do not set user, the app will run as root (undesirable)
|
17 |
RUN useradd -m -u 1000 user
|
18 |
USER user
|
|
|
19 |
# Set the home directory and path
|
20 |
ENV HOME=/home/user \
|
21 |
+
PATH=/home/user/.local/bin:$PATH
|
22 |
+
# NEW ENV STATEMENT
|
23 |
ENV UVICORN_WS_PROTOCOL=websockets
|
|
|
|
|
24 |
# Set the working directory
|
25 |
WORKDIR $HOME/app
|
|
|
26 |
# Copy the app to the container
|
27 |
COPY --chown=user . $HOME/app
|
|
|
28 |
# Install the dependencies
|
29 |
+
RUN uv sync --frozen
|
|
|
|
|
30 |
# Expose the port
|
31 |
EXPOSE 7860
|
|
|
32 |
# Run the app
|
33 |
+
CMD ["uv", "run", "chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]
|