omarsol commited on
Commit
38e513f
Β·
1 Parent(s): f5cdb39

Revert Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -23
Dockerfile CHANGED
@@ -1,34 +1,21 @@
1
- # Dockerfile
2
- FROM python:3.13-slim
3
 
4
- # (Recommended) Install curl & certs on -slim base
5
- RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates \
6
- && rm -rf /var/lib/apt/lists/*
7
 
8
- # Install uv to a global bin dir
9
- RUN curl -LsSf https://astral.sh/uv/install.sh | sh -s -- --bin-dir /usr/local/bin
10
- ENV PATH="/usr/local/bin:${PATH}"
11
 
12
- # Create the HF-required user (UID 1000) before copying files
13
  RUN useradd -m -u 1000 user
 
14
 
15
- # Work in the user's home to avoid permissions issues
16
- ENV HOME=/home/user \
17
- PATH="/root/.local/bin:/home/user/.local/bin:${PATH}"
18
- WORKDIR /home/user/app
19
 
20
- # Copy only deps first for better caching; make them owned by 'user'
21
- COPY --chown=user:user pyproject.toml uv.lock ./
22
 
23
- # Use the non-root user for env creation so .venv belongs to them
24
- USER user
25
- RUN uv sync --locked
26
 
27
- # Copy the rest of your app
28
- COPY --chown=user:user . .
 
29
 
30
- # Spaces expects your app to listen on this port; keep README app_port in sync
31
  EXPOSE 7860
32
-
33
- # Start the app via uv
34
  CMD ["uv", "run", "scripts/main.py"]
 
1
+ FROM python:3.13
 
2
 
3
+ RUN curl -LsSf https://astral.sh/uv/install.sh | sh
 
 
4
 
5
+ ENV PATH="/root/.local/bin:${PATH}"
 
 
6
 
 
7
  RUN useradd -m -u 1000 user
8
+ WORKDIR /app
9
 
10
+ COPY pyproject.toml uv.lock ./
11
+ RUN uv sync --locked
 
 
12
 
13
+ COPY . .
 
14
 
 
 
 
15
 
16
+ ENV HOME=/home/user PATH="/root/.local/bin:/home/user/.local/bin:${PATH}"
17
+ RUN chown -R user:user /app
18
+ USER user
19
 
 
20
  EXPOSE 7860
 
 
21
  CMD ["uv", "run", "scripts/main.py"]