From 604df32742870cb3a9ffcf20f199a8da6eef2ba6 Mon Sep 17 00:00:00 2001 From: SniperRus Date: Fri, 27 Sep 2024 04:56:38 +0300 Subject: [PATCH] Update Dockerfile/docker-compose.yml to include sqlite inside the container modify Dockerfile and docker-compose.yml by including sqlite3 into docker image, so no need to install it on a host machine and create volume link to sessions.db only one thing - we should create a file on a host machine anyway, before building a container. just put in console in current directory `touch sessions.db` it creates an empty file so when container created it will update it with a command `sqlite3 sessions.db "VACUUM;"` inside a container --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 80891d3..ce814a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,12 @@ FROM python:3.8-alpine +RUN apk add --no-cache sqlite sqlite-dev + WORKDIR /code COPY requirements.txt . RUN pip install -r requirements.txt COPY ./ . +RUN sqlite3 /code/sessions.db "VACUUM;" + ENTRYPOINT [ "python", "/code/bot.py" ]