Use python:3.11-slim-buster base for now

This commit is contained in:
Dave Gallant
2023-02-25 14:06:58 -05:00
parent 5cf4943f69
commit 39a8a18801
2 changed files with 17 additions and 18 deletions

11
.dockerignore Normal file
View File

@@ -0,0 +1,11 @@
.git
.github
.vscode
.mypy_cache
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
# C extensions
*.so

View File

@@ -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 WORKDIR /app
COPY pyproject.toml . COPY . .
COPY poetry.lock .
COPY rfd_notify .
RUN pip install poetry==1.3.2 && \ RUN pip install --no-cache-dir poetry==1.3.2 && \
/home/nonroot/.local/bin/poetry export -f requirements.txt > /tmp/requirements.txt poetry install --no-root
RUN pip install -r /tmp/requirements.txt --user ENTRYPOINT ["poetry", "run", "-C", "/app", "python", "/app/rfd_notify/cli.py", "-c", "config.yml"]
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"]