From daaa3e2c0748042a687b07d652bd97147aacb29d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Sat, 19 Feb 2022 01:45:40 +0100 Subject: [PATCH] Add VOLUME to Dockerfile --- extras/Dockerfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/extras/Dockerfile b/extras/Dockerfile index de06d39..a787abb 100644 --- a/extras/Dockerfile +++ b/extras/Dockerfile @@ -4,13 +4,13 @@ FROM python:3.9-slim # and we want the default answers to be used for all questions. ARG DEBIAN_FRONTEND=noninteractive -# Don't generate byte code (.pyc-files). +# Don't generate byte code (.pyc-files). # These are only needed if we run the python-files several times. # Docker doesn't keep the data between runs so this adds nothing. ENV PYTHONDONTWRITEBYTECODE 1 -# Force the stdout and stderr streams to be unbuffered. -# Will allow log messages to be immediately dumped instead of being buffered. +# Force the stdout and stderr streams to be unbuffered. +# Will allow log messages to be immediately dumped instead of being buffered. # This is useful when the bot crashes before writing messages stuck in the buffer. ENV PYTHONUNBUFFERED 1 @@ -22,7 +22,7 @@ RUN useradd --create-home botuser RUN chown -R botuser:botuser /home/botuser && chmod -R 755 /home/botuser USER botuser -# Create directory for the sqlite database. +# Create directory for the sqlite database. # You need to share this directory with the computer running # the container to save the data. RUN mkdir -p /home/botuser/data @@ -42,5 +42,7 @@ RUN poetry install --no-interaction --no-ansi --no-dev COPY discord_reminder_bot/main.py discord_reminder_bot/settings.py /home/botuser/discord_reminder_bot/ +VOLUME ["/home/botuser/data/"] + # Run bot. -CMD [ "poetry", "run", "bot" ] \ No newline at end of file +CMD [ "poetry", "run", "bot" ]