FROM alpine:latest

WORKDIR /bambulab-filament-tracker

COPY main.py ./

RUN apk update && apk add python3 py3-pip

RUN pip3 install --break-system-packages requests

RUN echo "*/30 * * * * python3 /bambulab-filament-tracker/main.py --db /bambulab-filament-tracker/data/db.sqlite3" | crontab -

VOLUME ["/bambulab-filament-tracker/data"]

CMD ["crond", "-f"]
