Ezhil commited on
Commit
8d08e7b
·
1 Parent(s): 7791260

edited docker

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -7
Dockerfile CHANGED
@@ -1,22 +1,23 @@
1
  # Use an official Python runtime as a parent image
2
  FROM python:3.11-slim
3
 
4
- # Set the working directory in the container
5
- WORKDIR /app
6
 
7
- COPY . /app
8
- # Ensure logs directory exists and set proper permissions
9
- RUN mkdir -p /app/logs && chmod -R 777 /app/logs
10
 
 
11
 
12
- # Copy the application files
 
13
 
 
14
 
15
  # Install dependencies
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
  # Expose the ports for FastAPI (8000) and Streamlit (8501)
19
- EXPOSE 7860
 
20
 
21
  # Run FastAPI and Streamlit in parallel
22
  CMD ["uvicorn" ,"backend.api.main:app","--host" ,"0.0.0.0", "--port", "7860"]
 
1
  # Use an official Python runtime as a parent image
2
  FROM python:3.11-slim
3
 
4
+ RUN useradd -m -u 1000 user
 
5
 
6
+ USER user
 
 
7
 
8
+ ENV PATH="home/user/.local/bin:$PATH"
9
 
10
+ # Set the working directory in the container
11
+ WORKDIR /app
12
 
13
+ COPY --chown=user ./requirements.txt requirements.txt
14
 
15
  # Install dependencies
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
  # Expose the ports for FastAPI (8000) and Streamlit (8501)
19
+
20
+ COPY --chown=user . /app
21
 
22
  # Run FastAPI and Streamlit in parallel
23
  CMD ["uvicorn" ,"backend.api.main:app","--host" ,"0.0.0.0", "--port", "7860"]