Skip to content

Instantly share code, notes, and snippets.

@BSVogler
Last active March 5, 2025 16:42
Show Gist options
  • Save BSVogler/dcd99a22f7131dcfa58bb9eb60f72964 to your computer and use it in GitHub Desktop.
Save BSVogler/dcd99a22f7131dcfa58bb9eb60f72964 to your computer and use it in GitHub Desktop.
Poetry Dockerfile
FROM python:3.13-slim
#libpq-dev python3-dev for psycopg
RUN apt-get update && apt-get -y install git curl #libldap2-dev libsasl2-dev g++ libffi-dev libpq-dev
RUN /usr/local/bin/python -m pip install --upgrade pip
ARG CI_COMMIT_SHA=local
ENV CI_COMMIT_SHA=$CI_COMMIT_SHA
ENV PYTHONUNBUFFERED=1
ARG PROJECT_ROOT="/app"
RUN mkdir $PROJECT_ROOT
WORKDIR $PROJECT_ROOT
ARG POETRY_VERSION=2.1.1
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/usr/local/ python3 - --version ${POETRY_VERSION}
RUN poetry config virtualenvs.create false
RUN poetry config virtualenvs.options.system-site-packages true
ENV PYTHONPATH=/usr/local/lib/python3.13/site-packages:${PYTHONPATH:-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment