Spaces:
Running
Running
FROM python:3.10-slim-buster | |
# Set the working directory inside the container | |
WORKDIR /app | |
# Install git | |
RUN apt-get update && \ | |
apt-get install -y git | |
# Clone the repository into the current directory | |
RUN git clone https://github.com/AttnVision/mp.git . | |
# Modify a specific file directly after clone (before dependencies are installed) | |
RUN python <<EOF | |
file_path = "mediaflow_proxy/configs.py" | |
with open(file_path, "r") as file: | |
content = file.read() | |
modified_content = content.replace("disable_home_page: bool = False", "disable_home_page: bool = True") | |
with open(file_path, "w") as file: | |
file.write(modified_content) | |
print(f"File modified: {file_path}") | |
EOF | |
# Proceed with pip installs | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Expose the port and run the service | |
EXPOSE 7860 | |
CMD ["uvicorn", "run:main_app", "--host", "0.0.0.0", "--port", "7860", "--workers", "4"] |