AdrienB134 commited on
Commit
e3163e4
·
verified ·
1 Parent(s): 7598777

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -5
Dockerfile CHANGED
@@ -1,8 +1,17 @@
1
  # Use Python 3.10 as base image
2
  FROM python:3.10-slim
 
 
3
 
4
- # Set working directory
5
- WORKDIR /app
 
 
 
 
 
 
 
6
 
7
  # Install system dependencies and uv
8
  RUN apt-get update && apt-get install -y \
@@ -19,9 +28,8 @@ COPY pyproject.toml .
19
  # Install Python dependencies using uv
20
  RUN . ~/.bashrc && uv pip install -r pyproject.toml --system
21
 
22
- # Copy the rest of the application
23
- COPY . .
24
-
25
  # Create directories for uploads and embeddings if they don't exist
26
  RUN mkdir -p uploads embeddings
27
 
 
1
  # Use Python 3.10 as base image
2
  FROM python:3.10-slim
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
  # Install system dependencies and uv
17
  RUN apt-get update && apt-get install -y \
 
28
  # Install Python dependencies using uv
29
  RUN . ~/.bashrc && uv pip install -r pyproject.toml --system
30
 
31
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
32
+ COPY --chown=user . $HOME/app
 
33
  # Create directories for uploads and embeddings if they don't exist
34
  RUN mkdir -p uploads embeddings
35