You can modify your 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
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" ]
#version: '3.8'
services:
hlllogutilities:
mem_limit: 512m
restart: unless-stopped
build: .
volumes:
- ./config.ini:/code/config.ini
# TODO: Sessions is not created before started first (unless done manually)
- ./sessions.db:/code/sessions.db
only one thing - you should create a file on a host machine anyway, just put in console
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
You can modify your 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 - you should create a file on a host machine anyway, just put in console
touch sessions.dbit creates an empty file so when container created it will update it with a command sqlite3 sessions.db "VACUUM;" inside a container