From 6069031742e6884a36c76d669a15c7d566bf28e9 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Sun, 20 Jul 2025 16:38:30 +0100 Subject: [PATCH] Add Dockerfile --- Dockerfile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5df9259 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +FROM python:3.12.3-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 + +# Install uv +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/ + +# System deps: +RUN apk add build-base unzip wget python3-dev libffi-dev rust cargo openssl-dev + +WORKDIR /src + +# Generate requirements and install *all* dependencies. +COPY pyproject.toml uv.lock /src/ +RUN uv export --format requirements-txt --output-file 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 +ENTRYPOINT [ "python3", "decrypt_otpauth.py" ] \ No newline at end of file