Azeez98 commited on
Commit
a0ea132
·
verified ·
1 Parent(s): bec03b3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -20
Dockerfile CHANGED
@@ -2,7 +2,7 @@
2
  FROM python:3.9-slim
3
 
4
  # Set work directory
5
- WORKDIR /usr/src/app
6
 
7
  # Set environment variables
8
  ENV PYTHONDONTWRITEBYTECODE 1
@@ -14,26 +14,13 @@ RUN apt-get update && \
14
  apt-get clean && \
15
  rm -rf /var/lib/apt/lists/*
16
 
17
- # Install pip and download dependencies
18
- RUN pip install --upgrade pip
19
- COPY ./requirements.txt .
20
 
21
- # Copy the requirements file and install dependencies
22
- COPY ./requirements1.txt /usr/src/app/requirements1.txt
23
- RUN pip install -r /usr/src/app/requirements.txt
24
 
25
- # Copy the FastAPI application
26
- COPY ./app.py /usr/src/app/app.py
27
 
28
- # Copy the shell script
29
- # COPY download_and_push.sh /usr/src/app/download_and_push.sh
30
 
31
- # Make the script executable
32
- # RUN chmod +x /usr/src/app/download_and_push.sh
33
-
34
- # Ensure the script runs with the correct permissions
35
- RUN chown -R root:root /usr/src/app
36
-
37
- # Set the entry point to run the script
38
- # ENTRYPOINT ["/usr/src/app/download_and_push.sh"]
39
- CMD ["uvicorn", "/usr/src/app:app", "--host", "0.0.0.0", "--port", "7860"]
 
2
  FROM python:3.9-slim
3
 
4
  # Set work directory
5
+ WORKDIR /app
6
 
7
  # Set environment variables
8
  ENV PYTHONDONTWRITEBYTECODE 1
 
14
  apt-get clean && \
15
  rm -rf /var/lib/apt/lists/*
16
 
17
+ RUN useradd -m -u 1000 user
 
 
18
 
19
+ COPY --chown=user ./requirements.txt requirements.txt
20
+ COPY --chown=user ./requirements1.txt requirements1.txt
 
21
 
22
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
23
 
24
+ COPY --chown=user . /app
 
25
 
26
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]