diff --git a/.github/workflows/dockerize.yaml b/.github/workflows/dockerize.yaml new file mode 100644 index 0000000..f6665f7 --- /dev/null +++ b/.github/workflows/dockerize.yaml @@ -0,0 +1,24 @@ +name: Build and push Docker image +on: + release: + types: [published] + workflow_dispatch: +jobs: + dockerize: + name: Build and push to GHCR + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v6 + - name: Build image + run: | + buildah build \ + -t ghcr.io/${{ github.repository }}:$GITHUB_REF_NAME \ + -t ghcr.io/${{ github.repository }}:latest . + - name: Push image + run: | + buildah login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io + buildah push ghcr.io/${{ github.repository }}:$GITHUB_REF_NAME + buildah push ghcr.io/${{ github.repository }}:latest diff --git a/Dockerfile b/Dockerfile index 7e8619e..0742c75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,13 @@ -FROM python:3.13-slim-bookworm +FROM ghcr.io/astral-sh/uv:python3.14-trixie-slim AS builder WORKDIR /app COPY . . -RUN pip install . && pip cache purge && rm -rf /app/* +RUN uv build + +FROM python:3.14-slim-trixie + +COPY --from=builder /app/dist/*.whl /tmp/ +RUN pip install --no-cache-dir /tmp/*.whl && rm /tmp/*.whl ENTRYPOINT ["crpy"] +CMD ["--help"] diff --git a/README.md b/README.md index 9943db1..04e6bb8 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,12 @@ If you want to live on the edge and have the latest development features, instal pip install git+https://github.com/bvanelli/crpy.git ``` +Alternatively, you can run it directly with Docker: + +```bash +docker run --rm ghcr.io/bvanelli/crpy:latest pull alpine:latest +``` + # Basic CLI usage For a preview of the options, here is the help command: