Niansuh commited on
Commit
ca87c3c
·
verified ·
1 Parent(s): b305edf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -2
Dockerfile CHANGED
@@ -4,13 +4,16 @@ FROM python:3.10-slim
4
  # Set the working directory in the container
5
  WORKDIR /app
6
 
7
- # Copy the current directory contents into the container
8
- COPY . /app
9
 
10
  # Install any needed packages specified in requirements.txt
11
  RUN pip install --no-cache-dir --upgrade pip && \
12
  pip install --no-cache-dir -r requirements.txt
13
 
 
 
 
14
  # Expose the port that the FastAPI app runs on
15
  EXPOSE 8001
16
 
 
4
  # Set the working directory in the container
5
  WORKDIR /app
6
 
7
+ # Copy only the requirements file first to leverage Docker cache
8
+ COPY requirements.txt /app/
9
 
10
  # Install any needed packages specified in requirements.txt
11
  RUN pip install --no-cache-dir --upgrade pip && \
12
  pip install --no-cache-dir -r requirements.txt
13
 
14
+ # Copy the current directory contents into the container
15
+ COPY . /app
16
+
17
  # Expose the port that the FastAPI app runs on
18
  EXPOSE 8001
19