ernestobs7 commited on
Commit
80733cd
·
1 Parent(s): bccc2a1

Fix: Install system dependencies as root before switching user

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -3
Dockerfile CHANGED
@@ -1,6 +1,9 @@
1
  # Get a distribution that has uv already installed
2
  FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
3
 
 
 
 
4
  # Add user - this is the user that will run the app
5
  RUN useradd -m -u 1000 user
6
  USER user
@@ -14,9 +17,6 @@ ENV UVICORN_WS_PROTOCOL=websockets
14
  # Set the working directory
15
  WORKDIR $HOME/app
16
 
17
- # Install required system dependencies for building packages
18
- RUN apt-get update && apt-get install -y gcc g++ python3-dev
19
-
20
  # Copy the app to the container
21
  COPY --chown=user . $HOME/app
22
 
 
1
  # Get a distribution that has uv already installed
2
  FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
3
 
4
+ # Install required system dependencies for building packages (as root)
5
+ RUN apt-get update && apt-get install -y gcc g++ python3-dev
6
+
7
  # Add user - this is the user that will run the app
8
  RUN useradd -m -u 1000 user
9
  USER user
 
17
  # Set the working directory
18
  WORKDIR $HOME/app
19
 
 
 
 
20
  # Copy the app to the container
21
  COPY --chown=user . $HOME/app
22