diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b4c98b6 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +.git +.github +.vscode +.mypy_cache + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] + +# C extensions +*.so diff --git a/Dockerfile b/Dockerfile index c00ac9d..510111a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,11 @@ -FROM cgr.dev/chainguard/python:dev-3.11.1 as builder +# syntax=docker/dockerfile:1 +FROM python:3.11-slim-buster WORKDIR /app -COPY pyproject.toml . -COPY poetry.lock . -COPY rfd_notify . +COPY . . -RUN pip install poetry==1.3.2 && \ - /home/nonroot/.local/bin/poetry export -f requirements.txt > /tmp/requirements.txt +RUN pip install --no-cache-dir poetry==1.3.2 && \ + poetry install --no-root -RUN pip install -r /tmp/requirements.txt --user - -FROM cgr.dev/chainguard/python:3.11.1 - -WORKDIR /app - -# Make sure you update Python version in path -COPY --from=builder /home/nonroot/.local/lib/python3.11/site-packages /home/nonroot/.local/lib/python3.11/site-packages - -COPY rfd_notify . - -ENTRYPOINT ["python", "/app/cli.py", "-c", "config.yml"] +ENTRYPOINT ["poetry", "run", "-C", "/app", "python", "/app/rfd_notify/cli.py", "-c", "config.yml"]