diff --git a/Dockerfile b/Dockerfile index 1a8d6c2..981fc71 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,11 @@ -# syntax=docker/dockerfile:1 -FROM python:3.12-alpine3.17 - +FROM python:3.13-slim-trixie AS builder WORKDIR /app - +COPY pyproject.toml poetry.lock* ./ +RUN pip install --no-cache-dir poetry==2.2.1 poetry-plugin-export && \ + poetry export -f requirements.txt --without-hashes --output requirements.txt +RUN python -m venv /venv && \ + /venv/bin/pip install --no-cache-dir -r requirements.txt COPY . . - -RUN pip install --no-cache-dir poetry==1.3.2 && \ - poetry export -f requirements.txt > /tmp/requirements.txt && \ - pip install -r /tmp/requirements.txt - -ENTRYPOINT ["python", "/app/rfd_notify/cli.py", "-c", "config.yml"] +ENV PATH="/venv/bin:$PATH" +RUN apt-get purge -y --allow-remove-essential bash +ENTRYPOINT ["/venv/bin/python", "rfd_notify/cli.py", "-c", "config.yml"] diff --git a/README.md b/README.md index 5bb502f..02c915d 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This was originally written before [alerts](https://www.redflagdeals.com/alerts/ The simplest way to get started is to clone this repo, and run with docker: ```sh -docker run -it -v "$(pwd)/examples/config.yml:/app/config.yml" ghcr.io/davegallant/rfd-notify:2 +docker run --rm -v "$(pwd)/examples/config.yml:/app/config.yml" $(docker build -q -t rfd-notify .) ``` To run the code with [poetry](https://python-poetry.org/), clone this repo and run the following: