Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +11 -23
Dockerfile
CHANGED
@@ -1,30 +1,18 @@
|
|
1 |
-
FROM python:3.
|
2 |
-
|
3 |
|
4 |
# Set up a new user named "user" with user ID 1000
|
5 |
RUN useradd -m -u 1000 user
|
|
|
|
|
6 |
|
7 |
-
|
8 |
-
USER user
|
9 |
-
|
10 |
-
# Set home to the user's home directory
|
11 |
-
ENV HOME=/home/user \
|
12 |
-
PATH=/home/user/.local/bin:$PATH
|
13 |
-
|
14 |
-
COPY --chown=user requirements.txt requirements.txt
|
15 |
-
|
16 |
-
COPY --chown=user app.py app.py
|
17 |
|
18 |
-
COPY --chown=user .
|
|
|
19 |
|
20 |
-
COPY --
|
21 |
-
|
22 |
-
|
23 |
-
# RUN pip install --no-cache-dir --upgrade pip
|
24 |
-
|
25 |
-
RUN uv venv
|
26 |
-
|
27 |
-
# Install requirements
|
28 |
-
RUN uv pip install --no-cache-dir --upgrade -r requirements.txt
|
29 |
|
30 |
-
|
|
|
1 |
+
FROM python:3.12
|
2 |
+
COPY --from=ghcr.io/astral-sh/uv:0.4.20 /uv /bin/uv
|
3 |
|
4 |
# Set up a new user named "user" with user ID 1000
|
5 |
RUN useradd -m -u 1000 user
|
6 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
7 |
+
ENV UV_SYSTEM_PYTHON=1
|
8 |
|
9 |
+
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
12 |
+
RUN uv pip install -r requirements.txt
|
13 |
|
14 |
+
COPY --chown=user . /app
|
15 |
+
# Switch to the "user" user
|
16 |
+
USER user
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
+
CMD ["solara", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]
|