Jirat Jaturanpinyo commited on
Commit
040ecc1
·
verified ·
1 Parent(s): 9da266c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -2
Dockerfile CHANGED
@@ -14,11 +14,14 @@ USER user
14
  # Create the app directory
15
  WORKDIR $HOME/app
16
 
17
- # Copy the current directory contents into the container at $HOME/app and set the owner to the user
18
- COPY --chown=user . $HOME/app
19
 
20
  # Install requirements.txt
21
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
22
 
 
 
 
23
  # Start the FastAPI app on port 7860, the default port expected by Spaces
24
  CMD ["python", "run.py", "--voicevox_dir", "../linux-cpu", "--host", "0.0.0.0", "--port", "7860"]
 
14
  # Create the app directory
15
  WORKDIR $HOME/app
16
 
17
+ # Copy the requirements.txt file first to leverage Docker cache
18
+ COPY --chown=user requirements.txt $HOME/app/
19
 
20
  # Install requirements.txt
21
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
22
 
23
+ # Copy the rest of the application code
24
+ COPY --chown=user . $HOME/app
25
+
26
  # Start the FastAPI app on port 7860, the default port expected by Spaces
27
  CMD ["python", "run.py", "--voicevox_dir", "../linux-cpu", "--host", "0.0.0.0", "--port", "7860"]