samu commited on
Commit
9955791
·
1 Parent(s): 6c8a2d5

modifying dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -15
Dockerfile CHANGED
@@ -1,21 +1,14 @@
1
  FROM python:3.9
 
2
 
3
- # Create a non-root user and set paths
4
- RUN useradd -m -u 1000 user
5
- USER user
6
- ENV PATH="/home/user/.local/bin:$PATH"
7
 
8
- WORKDIR /app
 
 
9
 
10
- # Copy and install dependencies
11
- COPY --chown=user ./requirements.txt requirements.txt
12
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
13
-
14
- # Copy the rest of the application files
15
- COPY --chown=user . /app
16
-
17
- # Ensure .env file exists before copying
18
- COPY --chown=user .env /app/.env
19
 
20
  CMD ["uvicorn", "backend.api.app:app", "--host", "0.0.0.0", "--port", "7860"]
21
-
 
1
  FROM python:3.9
2
+ WORKDIR /code
3
 
4
+ # Install dependencies
5
+ COPY ./requirements.txt /code/requirements.txt
6
+ RUN pip install --no-cache --upgrade -r /code/requirements.txt
 
7
 
8
+ # Copy application code and .env file
9
+ COPY ./backend /code/backend
10
+ COPY .env /code/.env
11
 
12
+ ENV PYTHONPATH=/code
 
 
 
 
 
 
 
 
13
 
14
  CMD ["uvicorn", "backend.api.app:app", "--host", "0.0.0.0", "--port", "7860"]