supertskone commited on
Commit
6ee292e
·
verified ·
1 Parent(s): 9548629

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -4
Dockerfile CHANGED
@@ -1,11 +1,29 @@
1
  # Use an official Python runtime as a parent image
2
  FROM python:3.12-slim
3
 
4
- # Set the working directory
5
- WORKDIR /app
 
6
 
7
- # Copy the current directory contents into the container at /app
8
- COPY . /app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  # Install system dependencies
11
  RUN apt-get update && apt-get install -y \
 
1
  # Use an official Python runtime as a parent image
2
  FROM python:3.12-slim
3
 
4
+ ### Set up user with permissions
5
+ # Set up a new user named "user" with user ID 1000
6
+ RUN useradd -m -u 1000 user
7
 
8
+ # Switch to the "user" user
9
+ USER user
10
+
11
+ # Set home to the user's home directory
12
+ ENV HOME=/home/user \
13
+ PATH=/home/user/.local/bin:$PATH
14
+
15
+ # Set the working directory to the user's home directory
16
+ WORKDIR $HOME/app
17
+
18
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
19
+ COPY --chown=user . $HOME/app
20
+
21
+
22
+ # # Set the working directory
23
+ # WORKDIR /app
24
+
25
+ # # Copy the current directory contents into the container at /app
26
+ # COPY . /app
27
 
28
  # Install system dependencies
29
  RUN apt-get update && apt-get install -y \