Skip to content

利用 AI 大模型和自动化工作流,根据主题或关键词一键生成高清短视频。Generate HD short videos from a topic or keyword with an automated AI workflow.

optimize dockerfile

harry64bfb21bf041
diff --git a/Dockerfile b/Dockerfile
index bd871c6c..16a444aa 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,7 +4,7 @@ FROM python:3.10-slim
# Set the working directory in the container
WORKDIR /MoneyPrinterTurbo
-ENV PYTHONPATH="/MoneyPrinterTurbo:$PYTHONPATH"
+ENV PYTHONPATH="/MoneyPrinterTurbo"
# Install system dependencies
RUN apt-get update && apt-get install -y \
@@ -17,11 +17,7 @@ RUN apt-get update && apt-get install -y \
RUN sed -i '/<policy domain="path" rights="none" pattern="@\*"/d' /etc/ImageMagick-6/policy.xml
# Copy the current directory contents into the container at /MoneyPrinterTurbo
-COPY ./app ./app
-COPY ./webui ./webui
-COPY ./resource ./resource
-COPY ./requirements.txt ./requirements.txt
-COPY ./main.py ./main.py
+COPY . .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
@@ -30,8 +26,13 @@ RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 8501
# Command to run the application
-CMD ["streamlit", "run", "./webui/Main.py","--browser.serverAddress=0.0.0.0","--server.enableCORS=True","--browser.gatherUsageStats=False"]
+CMD ["streamlit", "run", "./webui/Main.py","--browser.serverAddress=127.0.0.1","--server.enableCORS=True","--browser.gatherUsageStats=False"]
-# At runtime, mount the config.toml file from the host into the container
-# using Docker volumes. Example usage:
-# docker run -v ./config.toml:/MoneyPrinterTurbo/config.toml -v ./storage:/MoneyPrinterTurbo/storage -p 8501:8501 moneyprinterturbo
\ No newline at end of file
+# 1. Build the Docker image using the following command
+# docker build -t moneyprinterturbo .
+
+# 2. Run the Docker container using the following command
+## For Linux or MacOS:
+# docker run -v $(pwd)/config.toml:/MoneyPrinterTurbo/config.toml -v $(pwd)/storage:/MoneyPrinterTurbo/storage -p 8501:8501 moneyprinterturbo
+## For Windows:
+# docker run -v %cd%/config.toml:/MoneyPrinterTurbo/config.toml -v %cd%/storage:/MoneyPrinterTurbo/storage -p 8501:8501 moneyprinterturbo
\ No newline at end of file
diff --git a/docker-compose.yml b/docker-compose.yml
index 8c932bfa..7a69c427 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,8 +1,7 @@
version: "3"
x-common-volumes: &common-volumes
- - ./config.toml:/MoneyPrinterTurbo/config.toml
- - ./storage:/MoneyPrinterTurbo/storage
+ - ./:/MoneyPrinterTurbo
services:
webui:
@@ -12,7 +11,7 @@ services:
container_name: "webui"
ports:
- "8501:8501"
- command: ["streamlit", "run", "./webui/Main.py","--browser.serverAddress=0.0.0.0","--server.enableCORS=True","--browser.gatherUsageStats=False"]
+ command: [ "streamlit", "run", "./webui/Main.py","--browser.serverAddress=127.0.0.1","--server.enableCORS=True","--browser.gatherUsageStats=False" ]
volumes: *common-volumes
restart: always
api: