LPX55 commited on
Commit
94b5257
·
verified ·
1 Parent(s): 541fbbb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -1
Dockerfile CHANGED
@@ -1,12 +1,29 @@
1
  FROM python:3.10-slim-buster
2
 
 
3
  WORKDIR /app
4
 
5
- RUN apt-get update && apt-get install -y git
 
 
6
 
 
7
  RUN git clone https://github.com/AttnVision/mp.git .
8
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
 
11
  EXPOSE 7860
12
  CMD ["uvicorn", "run:main_app", "--host", "0.0.0.0", "--port", "7860", "--workers", "4"]
 
1
  FROM python:3.10-slim-buster
2
 
3
+ # Set the working directory inside the container
4
  WORKDIR /app
5
 
6
+ # Install git
7
+ RUN apt-get update && \
8
+ apt-get install -y git
9
 
10
+ # Clone the repository into the current directory
11
  RUN git clone https://github.com/AttnVision/mp.git .
12
 
13
+ # Modify a specific file directly after clone (before dependencies are installed)
14
+ RUN python <<EOF
15
+ file_path = "mediaflow_proxy/configs.py"
16
+ with open(file_path, "r") as file:
17
+ content = file.read()
18
+ modified_content = content.replace("disable_home_page: bool = False", "disable_home_page: bool = True")
19
+ with open(file_path, "w") as file:
20
+ file.write(modified_content)
21
+ print(f"File modified: {file_path}")
22
+ EOF
23
+
24
+ # Proceed with pip installs
25
  RUN pip install --no-cache-dir -r requirements.txt
26
 
27
+ # Expose the port and run the service
28
  EXPOSE 7860
29
  CMD ["uvicorn", "run:main_app", "--host", "0.0.0.0", "--port", "7860", "--workers", "4"]