Jules commited on
Commit
ea2f2ad
·
1 Parent(s): f3a335e

Install dependencies as root before switching to non-root user

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -6
Dockerfile CHANGED
@@ -10,19 +10,19 @@ RUN apt-get update && apt-get install -y \
10
  # Install uv
11
  COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
12
 
13
- # Set up a non-root user
14
- RUN useradd -m -u 1000 user
15
- USER user
16
- ENV PATH="/home/user/.local/bin:$PATH"
17
-
18
  WORKDIR /app
19
 
20
  # Copy requirements and install
21
- COPY --chown=user requirements.txt .
22
  RUN uv pip install --system -r requirements.txt
23
 
 
 
 
 
24
  # Copy the rest of the application
25
  COPY --chown=user . .
 
26
 
27
  # Expose the port
28
  EXPOSE 7860
 
10
  # Install uv
11
  COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
12
 
 
 
 
 
 
13
  WORKDIR /app
14
 
15
  # Copy requirements and install
16
+ COPY requirements.txt .
17
  RUN uv pip install --system -r requirements.txt
18
 
19
+ # Set up a non-root user
20
+ RUN useradd -m -u 1000 user
21
+ ENV PATH="/home/user/.local/bin:$PATH"
22
+
23
  # Copy the rest of the application
24
  COPY --chown=user . .
25
+ USER user
26
 
27
  # Expose the port
28
  EXPOSE 7860