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"] 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?