Jayra Ortiz commited on
Commit
dcd924f
·
1 Parent(s): 8697050

:bug: changed permisssion

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -7
Dockerfile CHANGED
@@ -3,8 +3,7 @@ FROM python:3.9
3
 
4
  # Set the working directory in the container
5
 
6
-
7
- ENV WORKDIR=/app
8
  WORKDIR ${WORKDIR}
9
 
10
  # Copy the requirements file into the container
@@ -13,11 +12,17 @@ COPY requirements.txt .
13
  # Install the Python dependencies
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
- # Copy the application code into the container
17
- COPY . .
 
 
 
18
 
19
- ENV PYTHONPATH "${PYTHONPATH}:/code/"
 
 
 
20
 
21
  # Define default run command
22
- WORKDIR ${WORKDIR}/
23
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]
 
3
 
4
  # Set the working directory in the container
5
 
6
+ ENV WORKDIR=/code
 
7
  WORKDIR ${WORKDIR}
8
 
9
  # Copy the requirements file into the container
 
12
  # Install the Python dependencies
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
+ #Permission Settings
16
+ RUN useradd -m -u 1000 user
17
+ USER user
18
+ ENV HOME=/home/user \
19
+ PATH=/home/user/.local/bin:$PATH
20
 
21
+ WORKDIR $HOME/app
22
+
23
+ # Copy the application code into the container
24
+ COPY --chown=user . $HOME/app
25
 
26
  # Define default run command
27
+ WORKDIR $HOME/app
28
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]