From af2a5c8bccf60d66c7975774c7476bc5f7f9eaba Mon Sep 17 00:00:00 2001 From: Puru <5674762+tuladhar@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:07:26 +0545 Subject: [PATCH 1/2] Create Dockerfile.python --- Dockerfile.python | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Dockerfile.python diff --git a/Dockerfile.python b/Dockerfile.python new file mode 100644 index 0000000..3a313c5 --- /dev/null +++ b/Dockerfile.python @@ -0,0 +1,17 @@ +# Use an official Python runtime as the base image +FROM python:3.9-slim + +# Set the working directory in the container +WORKDIR /app + +# Copy the Python script into the container +COPY mkbsd.py /app/mkbsd.py + +# Install the required packages +RUN pip install aiohttp + +# Set Python to run in unbuffered mode +ENV PYTHONUNBUFFERED=1 + +# Run the script when the container launches +CMD ["python", "mkbsd.py"] From b54ff634699d3a5385c1614154e97b7210db4311 Mon Sep 17 00:00:00 2001 From: Puru <5674762+tuladhar@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:12:32 +0545 Subject: [PATCH 2/2] Update README.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 2d34182..9cb8027 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,18 @@ MKBSD comes in two variants! Node.js and Python. 4. Wait a little. 5. All wallpapers are now in a newly created `downloads` subfolder. +### Running in Python (Docker) + +1. Ensure you have Docker installed. [Get Docker](https://docs.docker.com/get-docker/) +2. Build the container image: +``` +docker build -t mkbsd:python -f Dockerfile.python . +``` +3. Run the container: +``` +docker run -v $PWD/downloads:/app/downloads mkbsd:python +``` + ## FAQ ### Q: What's the story behind this?