2024-04-02 11:03:29 +08:00
|
|
|
# Use an official Python runtime as a parent image
|
|
|
|
|
FROM python:3.10-slim
|
|
|
|
|
|
|
|
|
|
# Set the working directory in the container
|
2024-04-03 14:13:54 +08:00
|
|
|
WORKDIR /MoneyPrinterTurbo
|
|
|
|
|
|
|
|
|
|
ENV PYTHONPATH="/MoneyPrinterTurbo:$PYTHONPATH"
|
2024-04-02 11:03:29 +08:00
|
|
|
|
|
|
|
|
# Install system dependencies
|
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
|
git \
|
|
|
|
|
imagemagick \
|
2024-04-03 14:13:54 +08:00
|
|
|
ffmpeg \
|
2024-04-02 11:03:29 +08:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
2024-04-02 12:06:08 +08:00
|
|
|
# Fix security policy for ImageMagick
|
|
|
|
|
RUN sed -i '/<policy domain="path" rights="none" pattern="@\*"/d' /etc/ImageMagick-6/policy.xml
|
|
|
|
|
|
2024-04-03 14:13:54 +08:00
|
|
|
# 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
|
2024-04-02 11:03:29 +08:00
|
|
|
|
|
|
|
|
# Install Python dependencies
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
|
# Expose the port the app runs on
|
2024-04-03 14:13:54 +08:00
|
|
|
EXPOSE 8501
|
2024-04-02 11:03:29 +08:00
|
|
|
|
|
|
|
|
# Command to run the application
|
2024-04-03 14:13:54 +08:00
|
|
|
CMD ["streamlit", "run", "./webui/Main.py","--browser.serverAddress=0.0.0.0","--server.enableCORS=True","--browser.gatherUsageStats=False"]
|
2024-04-02 11:03:29 +08:00
|
|
|
|
|
|
|
|
# At runtime, mount the config.toml file from the host into the container
|
|
|
|
|
# using Docker volumes. Example usage:
|
2024-04-03 14:13:54 +08:00
|
|
|
# docker run -v ./config.toml:/MoneyPrinterTurbo/config.toml -v ./storage:/MoneyPrinterTurbo/storage -p 8501:8501 moneyprinterturbo
|