Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/withlogicco/docker-poetry

Docker image for Python projects with Poetry managed dependencies
https://github.com/withlogicco/docker-poetry

docker docker-image python python-poetry

Last synced: about 2 months ago
JSON representation

Docker image for Python projects with Poetry managed dependencies

Awesome Lists containing this project

README

        

# Docker Poetry

Docker Poetry is a Docker image for Python projects with dependencies managed by Poetry.

![Poetry](https://img.shields.io/badge/Poetry-1.8.3-purple) ![Python](https://img.shields.io/badge/Python-3.12%20(default)%20%7C%203.11%20%7C%203.10%20%7C%203.9%20%7C%203.8-blue) ![Variants](https://img.shields.io/badge/Variants-Bookworm%20(default)%20%7C%20Slim-orange
)

## Why

At LOGIC our go-to stack for web applications is; the latest LTS Django on the latest Python using Poetry as our dependency manager in Docker. [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) is a core principle for us, so a public Docker image with the right Python and Poetry version is an exceptional base for new projects.

## Tags

For the simplest use case just pick your Poetry version:

```
ghcr.io/withlogicco/poetry:
```

This will use the default Python version (latest) and image variant (Bookworm). You can be more specific by picking either a Python version, image variant or both:

- Python version: `ghcr.io/withlogicco/poetry:-python-`
- Image variant: `ghcr.io/withlogicco/poetry:-`
- Python version and image variant: `ghcr.io/withlogicco/poetry:-python--`

### Examples

- Poetry 1.8.3: `ghcr.io/withlogicco/poetry:1.8.3`
- Poetry 1.8.3 on Python 3.12: `ghcr.io/withlogicco/poetry:1.8.3-python-3.12`
- Poetry 1.8.3 on Bookworm: `ghcr.io/withlogicco/poetry:1.8.3-bookworm`
- Poetry 1.8.3 on Python 3.12 and Bookworm: `ghcr.io/withlogicco/poetry:1.8.3-python-3.12-bookworm`

## Usage

First, pick the image tag you wish to use. Then, copy your `pyproject.toml` and `poetry.lock` files in the working directory (`/usr/src/app`), for optimal caching and run `poetry install`. Example:

```dockerfile
FROM ghcr.io/withlogicco/poetry:1.8.3

COPY pyproject.toml poetry.lock ./
RUN poetry install

COPY ./ ./
```

## Supported versions

### Poetry

Only the latest version of Poetry is included in each build.

### Python (optional)

A build will be provided for each Python version still under maintenance and support. The latest Python version acts as the default in each build.

You can check the currently supported Python versions at https://endoflife.date/python.

### Variants (optional)

We provide builds for three different image variants:

- Debian Bookworm (default): `bookworm`
- Debian Slim: `slim`

## License

This project is [MIT licensed](LICENSE).

---


🦄 Built with LOGIC. 🦄