Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +18 -1
Dockerfile
CHANGED
|
@@ -1,12 +1,29 @@
|
|
| 1 |
FROM python:3.10-slim-buster
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
| 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"]
|