Created
July 28, 2024 23:13
-
-
Save dkarchmer/e5dbaf9e1b09973838a7074006b8d0d5 to your computer and use it in GitHub Desktop.
Dockerfile for Python with PDM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.12-slim as production | |
ENV DEBIAN_FRONTEND="noninteractive" | |
SHELL ["/bin/bash", "-c"] | |
WORKDIR /app | |
RUN set -eux; \ | |
apt-get update && \ | |
apt-get install --no-install-recommends -y mime-support git curl libcurl4-openssl-dev \ | |
libssl-dev make g++ procps tzdata xmlsec1 node-typescript gettext | |
ENV PATH="/root/.local/bin:$PATH" | |
RUN curl -sSL https://pdm-project.org/install-pdm.py | python3 - | |
COPY pyproject.toml pdm.lock /app/ | |
RUN pdm config python.use_venv false | |
RUN pdm sync --prod --global -p . | |
RUN apt-get remove --purge -y git libcurl4-openssl-dev libssl-dev make g++ && \ | |
apt-get autoremove -y && \ | |
apt-get clean -y && \ | |
rm -rf /var/lib/apt/lists/* | |
COPY . /app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment