AdrienB134 commited on
Commit
99c60dd
·
verified ·
1 Parent(s): 5918ff6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -10
Dockerfile CHANGED
@@ -1,14 +1,6 @@
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
  # Install system dependencies and uv
14
  RUN sudo apt-get update && apt-get install -y \
@@ -18,7 +10,16 @@ RUN sudo apt-get update && apt-get install -y \
18
  && curl -LsSf https://astral.sh/uv/install.sh | sh \
19
  && echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc \
20
  && . ~/.bashrc
21
-
 
 
 
 
 
 
 
 
 
22
 
23
 
24
  # Set the working directory to the user's home directory
@@ -27,11 +28,24 @@ WORKDIR $HOME/app
27
 
28
 
29
  # Copy requirements first to leverage Docker cache
30
- COPY --chown=user pyproject.toml .
31
 
32
  # Install Python dependencies using uv
33
  RUN . ~/.bashrc && uv pip install -r pyproject.toml --system
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  # Copy the current directory contents into the container at $HOME/app setting the owner to the user
36
  COPY --chown=user . $HOME/app
37
  # Create directories for uploads and embeddings if they don't exist
 
1
  # Use Python 3.10 as base image
2
  FROM python:3.10-slim
 
 
 
 
 
3
 
 
 
 
4
 
5
  # Install system dependencies and uv
6
  RUN sudo apt-get update && apt-get install -y \
 
10
  && curl -LsSf https://astral.sh/uv/install.sh | sh \
11
  && echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc \
12
  && . ~/.bashrc
13
+
14
+ # Set up a new user named "user" with user ID 1000
15
+ RUN useradd -m -u 1000 user
16
+
17
+ # Switch to the "user" user
18
+ USER user
19
+
20
+ # Set home to the user's home directory
21
+ ENV HOME=/home/user \
22
+ PATH=/home/user/.local/bin:$PATH
23
 
24
 
25
  # Set the working directory to the user's home directory
 
28
 
29
 
30
  # Copy requirements first to leverage Docker cache
31
+ COPY pyproject.toml .
32
 
33
  # Install Python dependencies using uv
34
  RUN . ~/.bashrc && uv pip install -r pyproject.toml --system
35
 
36
+ # Set up a new user named "user" with user ID 1000
37
+ RUN useradd -m -u 1000 user
38
+
39
+ # Switch to the "user" user
40
+ USER user
41
+
42
+ # Set home to the user's home directory
43
+ ENV HOME=/home/user \
44
+ PATH=/home/user/.local/bin:$PATH
45
+
46
+
47
+ # Set the working directory to the user's home directory
48
+ WORKDIR $HOME/app
49
  # Copy the current directory contents into the container at $HOME/app setting the owner to the user
50
  COPY --chown=user . $HOME/app
51
  # Create directories for uploads and embeddings if they don't exist