mirror of
https://github.com/nikdoof/simple-webfinger.git
synced 2025-12-13 10:22:15 +00:00
42
Dockerfile
42
Dockerfile
@@ -1,13 +1,33 @@
|
||||
# syntax=docker/dockerfile:1.9
|
||||
FROM --platform=$BUILDPLATFORM python:3.12-alpine
|
||||
FROM python:3.12.2-alpine3.18 AS base
|
||||
|
||||
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.12/site-packages" \
|
||||
# Versions:
|
||||
POETRY_VERSION=1.7.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 . /app
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt /app
|
||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
pip3 install -r requirements.txt
|
||||
|
||||
COPY app.py /app
|
||||
|
||||
ENTRYPOINT ["python3"]
|
||||
CMD ["app.py"]
|
||||
CMD ["/usr/local/bin/uvicorn", "simple_webfinger.app:app", "--host", "0.0.0.0", "--port", "80", "--proxy-headers"]
|
||||
Reference in New Issue
Block a user