LeoArtaza commited on
Commit
2bff27d
1 Parent(s): 4ca7cd4

Agregar user para permissions

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -5
Dockerfile CHANGED
@@ -1,14 +1,21 @@
1
- # Use an official Python runtime as a parent image
2
- FROM python:3.11
 
 
 
 
 
 
 
3
 
4
  # Set the working directory in the container
5
- WORKDIR /code
6
 
7
  # Copy the dependencies file to the working directory
8
- COPY ./requirements.txt /code/requirements.txt
9
 
10
  # Install any dependencies
11
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
12
 
13
  # Copy the content of the local src directory to the working directory
14
  COPY . .
 
1
+ # Set up a new user named "user" with user ID 1000
2
+ RUN useradd -m -u 1000 user
3
+
4
+ # Switch to the "user" user
5
+ USER user
6
+
7
+ # Set home to the user's home directory
8
+ ENV HOME=/home/user \
9
+ PATH=/home/user/.local/bin:$PATH
10
 
11
  # Set the working directory in the container
12
+ WORKDIR $HOME/app
13
 
14
  # Copy the dependencies file to the working directory
15
+ COPY ./requirements.txt /app/requirements.txt
16
 
17
  # Install any dependencies
18
+ RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
19
 
20
  # Copy the content of the local src directory to the working directory
21
  COPY . .