added Dockerfile
This commit is contained in:
19
Dockerfile
19
Dockerfile
@@ -2,29 +2,36 @@
|
|||||||
FROM python:3.10-slim
|
FROM python:3.10-slim
|
||||||
|
|
||||||
# Set the working directory in the container
|
# Set the working directory in the container
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /MoneyPrinterTurbo
|
||||||
|
|
||||||
|
ENV PYTHONPATH="/MoneyPrinterTurbo:$PYTHONPATH"
|
||||||
|
|
||||||
# Install system dependencies
|
# Install system dependencies
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
git \
|
git \
|
||||||
imagemagick \
|
imagemagick \
|
||||||
|
ffmpeg \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Fix security policy for ImageMagick
|
# Fix security policy for ImageMagick
|
||||||
RUN sed -i '/<policy domain="path" rights="none" pattern="@\*"/d' /etc/ImageMagick-6/policy.xml
|
RUN sed -i '/<policy domain="path" rights="none" pattern="@\*"/d' /etc/ImageMagick-6/policy.xml
|
||||||
|
|
||||||
# Copy the current directory contents into the container at /usr/src/app
|
# Copy the current directory contents into the container at /MoneyPrinterTurbo
|
||||||
COPY . .
|
COPY ./app ./app
|
||||||
|
COPY ./webui ./webui
|
||||||
|
COPY ./resource ./resource
|
||||||
|
COPY ./requirements.txt ./requirements.txt
|
||||||
|
COPY ./main.py ./main.py
|
||||||
|
|
||||||
# Install Python dependencies
|
# Install Python dependencies
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
# Expose the port the app runs on
|
# Expose the port the app runs on
|
||||||
EXPOSE 8080
|
EXPOSE 8501
|
||||||
|
|
||||||
# Command to run the application
|
# Command to run the application
|
||||||
CMD ["python", "main.py"]
|
CMD ["streamlit", "run", "./webui/Main.py","--browser.serverAddress=0.0.0.0","--server.enableCORS=True","--browser.gatherUsageStats=False"]
|
||||||
|
|
||||||
# At runtime, mount the config.toml file from the host into the container
|
# At runtime, mount the config.toml file from the host into the container
|
||||||
# using Docker volumes. Example usage:
|
# using Docker volumes. Example usage:
|
||||||
# docker run -v /path/to/your/config.toml:/usr/src/app/config.toml -p 8080:8080 moneyprinterturbo
|
# docker run -v ./config.toml:/MoneyPrinterTurbo/config.toml -v ./storage:/MoneyPrinterTurbo/storage -p 8501:8501 moneyprinterturbo
|
||||||
27
docker-compose.yml
Normal file
27
docker-compose.yml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
x-common-volumes: &common-volumes
|
||||||
|
- ./config.toml:/MoneyPrinterTurbo/config.toml
|
||||||
|
- ./storage:/MoneyPrinterTurbo/storage
|
||||||
|
|
||||||
|
services:
|
||||||
|
webui:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
container_name: "webui"
|
||||||
|
ports:
|
||||||
|
- "8501:8501"
|
||||||
|
command: ["streamlit", "run", "./webui/Main.py","--browser.serverAddress=0.0.0.0","--server.enableCORS=True","--browser.gatherUsageStats=False"]
|
||||||
|
volumes: *common-volumes
|
||||||
|
restart: always
|
||||||
|
api:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
container_name: "api"
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
command: [ "python3", "main.py" ]
|
||||||
|
volumes: *common-volumes
|
||||||
|
restart: always
|
||||||
Reference in New Issue
Block a user