Update Dockerfile
Browse files- Dockerfile +4 -33
Dockerfile
CHANGED
@@ -1,39 +1,10 @@
|
|
1 |
FROM ubuntu
|
2 |
-
|
3 |
-
|
4 |
-
WORKDIR /MoneyPrinterTurbo
|
5 |
-
|
6 |
-
# 设置/MoneyPrinterTurbo目录权限为777
|
7 |
-
RUN chmod 777 /MoneyPrinterTurbo
|
8 |
-
|
9 |
-
ENV PYTHONPATH="/MoneyPrinterTurbo"
|
10 |
-
|
11 |
-
# Install system dependencies
|
12 |
RUN <<EOF
|
13 |
apt update
|
14 |
apt install -y --no-install-recommends python3-pip git imagemagick ffmpeg
|
15 |
sed -i '/<policy domain="path" rights="none" pattern="@\*"/d' /etc/ImageMagick-6/policy.xml
|
|
|
16 |
EOF
|
17 |
-
|
18 |
-
# Copy only the requirements.txt first to leverage Docker cache
|
19 |
-
COPY requirements.txt ./
|
20 |
-
|
21 |
-
# Install Python dependencies
|
22 |
-
RUN pip install --no-cache-dir -r requirements.txt --break-system-packages
|
23 |
-
|
24 |
-
# Now copy the rest of the codebase into the image
|
25 |
-
COPY . .
|
26 |
-
|
27 |
-
# Expose the port the app runs on
|
28 |
-
|
29 |
-
# Command to run the application
|
30 |
-
CMD ["streamlit", "run", "./webui/Main.py","--browser.serverAddress=127.0.0.1","--server.enableCORS=True","--browser.gatherUsageStats=False", "--server.port=7860"]
|
31 |
-
|
32 |
-
# 1. Build the Docker image using the following command
|
33 |
-
# docker build -t moneyprinterturbo .
|
34 |
-
|
35 |
-
# 2. Run the Docker container using the following command
|
36 |
-
## For Linux or MacOS:
|
37 |
-
# docker run -v $(pwd)/config.toml:/MoneyPrinterTurbo/config.toml -v $(pwd)/storage:/MoneyPrinterTurbo/storage -p 8501:8501 moneyprinterturbo
|
38 |
-
## For Windows:
|
39 |
-
# docker run -v ${PWD}/config.toml:/MoneyPrinterTurbo/config.toml -v ${PWD}/storage:/MoneyPrinterTurbo/storage -p 8501:8501 moneyprinterturbo
|
|
|
1 |
FROM ubuntu
|
2 |
+
WORKDIR /home/ubuntu
|
3 |
+
COPY . .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
RUN <<EOF
|
5 |
apt update
|
6 |
apt install -y --no-install-recommends python3-pip git imagemagick ffmpeg
|
7 |
sed -i '/<policy domain="path" rights="none" pattern="@\*"/d' /etc/ImageMagick-6/policy.xml
|
8 |
+
python3 -m pip install --no-cache-dir -r requirements.txt --break-system-packages
|
9 |
EOF
|
10 |
+
ENTRYPOINT ["streamlit", "run", "./webui/Main.py","--server.enableCORS=True","--browser.gatherUsageStats=False", "--server.port=7860"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|