Skip to content

Instantly share code, notes, and snippets.

@Dimfred
Created August 3, 2022 10:11
Show Gist options
  • Save Dimfred/5d6a9577fa9a971ae905b0a5ec1b0dab to your computer and use it in GitHub Desktop.
Save Dimfred/5d6a9577fa9a971ae905b0a5ec1b0dab to your computer and use it in GitHub Desktop.
poetry for python3.9 alpine linux (ssh enabled)
FROM python:3.9-alpine
################################################################################
# PYTHON INIT
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
LANG=C.UTF-8 \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100
################################################################################
# SSH SETUP
RUN apk update && apk add curl openssh-client build-base linux-headers git
RUN mkdir -p -m 0600 /root/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
################################################################################
# POETRY
RUN pip3 install --upgrade pip \
&& pip3 install poetry \
&& poetry config virtualenvs.create false
################################################################################
# INSTALL
# COPY .pyproject.toml ./poetry.lock ./
# RUN --mount=type=ssh poetry install --no-dev --no-interaction --no-ansi -vvv
# RUN apk del curl openssh-client build-base linux-headers git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment