Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dstockhammer/docker-python-poetry
Docker image with Python + Poetry
https://github.com/dstockhammer/docker-python-poetry
docker poetry python
Last synced: about 2 months ago
JSON representation
Docker image with Python + Poetry
- Host: GitHub
- URL: https://github.com/dstockhammer/docker-python-poetry
- Owner: dstockhammer
- License: mit
- Created: 2023-05-01T13:48:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-10T13:47:26.000Z (4 months ago)
- Last Synced: 2024-09-10T15:22:27.842Z (4 months ago)
- Topics: docker, poetry, python
- Language: Dockerfile
- Homepage:
- Size: 42 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-python-poetry
Docker image containing [Python](https://www.python.org) + [Poetry](https://python-poetry.org).
[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/dstockhammer/python-poetry?sort=semver)](https://hub.docker.com/r/dstockhammer/python-poetry)
[![GitHub last commit](https://img.shields.io/github/last-commit/dstockhammer/docker-python-poetry)](https://github.com/dstockhammer/docker-python-poetry/commits/main)## Usage
```dockerfile
FROM dstockhammer/python-poetry:3.11 AS builderWORKDIR /app
ENV POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_OPTIONS_ALWAYS_COPY=1 \
POETRY_VIRTUALENVS_OPTIONS_NO_PIP=1 \
POETRY_VIRTUALENVS_OPTIONS_NO_SETUPTOOLS=1COPY pyproject.toml poetry.lock ./
RUN poetry install --only=main --no-root --no-ansi --no-interactionFROM python:3.11-slim
WORKDIR /app
ENV PYTHONFAULTHANDLER=1 \
PYTHONHASHSEED=random \
PYTHONUNBUFFERED=1RUN addgroup app --gid 1000 \
&& adduser app --home /app --uid 1000 --gid 1000 --disabled-login --disabled-passwordCOPY --from=builder /app/.venv ./.venv
COPY src ./srcUSER 1000
ENTRYPOINT [ "/app/.venv/bin/python" ]
```