-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
488 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,33 @@ | ||
FROM python:3.11.5-alpine3.18 | ||
FROM python:3.11.5-alpine3.18 AS base | ||
|
||
WORKDIR /code | ||
COPY ./requirements.txt /code/requirements.txt | ||
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | ||
COPY ./gocardless_membership_exporter /code/gocardless_membership_exporter | ||
FROM base AS builder | ||
|
||
ENV PYTHONFAULTHANDLER=1 \ | ||
PYTHONUNBUFFERED=1 \ | ||
PYTHONHASHSEED=random \ | ||
PIP_NO_CACHE_DIR=off \ | ||
PIP_DISABLE_PIP_VERSION_CHECK=on \ | ||
PIP_DEFAULT_TIMEOUT=100 \ | ||
POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_CREATE=false \ | ||
PATH="$PATH:/runtime/bin" \ | ||
PYTHONPATH="$PYTHONPATH:/runtime/lib/python3.11/site-packages" \ | ||
# Versions: | ||
POETRY_VERSION=1.5.1 | ||
|
||
# System deps: | ||
RUN apk add build-base unzip wget python3-dev libffi-dev | ||
RUN pip install "poetry==$POETRY_VERSION" | ||
|
||
WORKDIR /src | ||
|
||
# Generate requirements and install *all* dependencies. | ||
COPY pyproject.toml poetry.lock /src/ | ||
RUN poetry export --dev --without-hashes --no-interaction --no-ansi -f requirements.txt -o requirements.txt | ||
RUN pip install --prefix=/runtime --force-reinstall -r requirements.txt | ||
|
||
FROM base AS runtime | ||
COPY --from=builder /runtime /usr/local | ||
COPY ./gocardless_membership_exporter /app/gocardless_membership_exporter | ||
WORKDIR /app | ||
CMD ["python", "-m", "gocardless_membership_exporter"] |
Oops, something went wrong.