MikeCraBash commited on
Commit
427488a
·
verified ·
1 Parent(s): 1340ce0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -4
Dockerfile CHANGED
@@ -1,9 +1,7 @@
1
-
2
  # Get a distribution that has uv already installed
3
  FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
4
 
5
  # Add user - this is the user that will run the app
6
- # If you do not set user, the app will run as root (undesirable)
7
  RUN useradd -m -u 1000 user
8
  USER user
9
 
@@ -13,15 +11,20 @@ ENV HOME=/home/user \
13
 
14
  ENV UVICORN_WS_PROTOCOL=websockets
15
 
16
-
17
  # Set the working directory
18
  WORKDIR $HOME/app
19
 
 
 
 
 
 
 
 
20
  # Copy the app to the container
21
  COPY --chown=user . $HOME/app
22
 
23
  # Install the dependencies
24
- # RUN uv sync --frozen
25
  RUN uv sync
26
 
27
  # Expose the port
 
 
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
7
 
 
11
 
12
  ENV UVICORN_WS_PROTOCOL=websockets
13
 
 
14
  # Set the working directory
15
  WORKDIR $HOME/app
16
 
17
+ # Install missing dependencies for NumPy
18
+ USER root # Temporarily switch to root to install dependencies
19
+ RUN apt update && apt install -y --no-install-recommends \
20
+ build-essential gcc g++ clang python3-dev
21
+
22
+ USER user # Switch back to user
23
+
24
  # Copy the app to the container
25
  COPY --chown=user . $HOME/app
26
 
27
  # Install the dependencies
 
28
  RUN uv sync
29
 
30
  # Expose the port