alonsosilva commited on
Commit
f8517ba
·
unverified ·
1 Parent(s): d8eb0d7

Change to uv

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -21
Dockerfile CHANGED
@@ -1,28 +1,18 @@
1
- FROM python:3.11
 
2
 
3
  # Set up a new user named "user" with user ID 1000
4
  RUN useradd -m -u 1000 user
 
 
5
 
6
- # Switch to the "user" user
7
- USER user
8
-
9
- # Set home to the user's home directory
10
- ENV HOME=/home/user \
11
- PATH=/home/user/.local/bin:$PATH
12
-
13
- # Set the working directory to the user's home directory
14
- WORKDIR $HOME/app
15
-
16
- # Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
17
- RUN pip install --no-cache-dir --upgrade pip
18
 
19
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
20
- COPY --chown=user . $HOME/app
21
 
22
- COPY --chown=user requirements.txt .
23
-
24
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
25
-
26
- COPY --chown=user app.py app.py
27
 
28
- ENTRYPOINT ["solara", "run", "app.py", "--host=0.0.0.0", "--port", "7860"]
 
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"]