FROM python:3.14.5-alpine3.23
# Build-time and runtime dependencies are installed via apk (Alpine)
# The image is configured to build and install dirhunt from source
ENV PYTHONUNBUFFERED=1
# Install build tools and TLS dependencies
RUN apk add --no-cache --virtual .build-deps build-base linux-headers openssl-dev zlib-dev libffi-dev \
&& apk add --no-cache ca-certificates \
&& update-ca-certificates
WORKDIR /app
# Install Python dependencies first (as per build commands in the blueprint)
COPY requirements.txt requirements.txt
COPY requirements.in requirements.in
RUN python -m pip install --upgrade pip \
&& pip install -r requirements.txt
# Copy the project sources
COPY . .
# Build and install the package from source
RUN python -m pip install .
# Cleanup build dependencies to keep the final image smaller
RUN apk del .build-deps
# Expose the CLI entrypoint defined in setup.py
ENTRYPOINT ["dirhunt"]
# Default to showing help if no arguments are provided
CMD ["--help"]
FROM python:3.14.5-alpine3.23
ENV PYTHONUNBUFFERED=1
# Install build tools and TLS dependencies
RUN set -eux; \
apk add --no-cache --virtual .build-deps build-base linux-headers openssl-dev zlib-dev libffi-dev ca-certificates; \
update-ca-certificates
WORKDIR /app
# Copy dependency specification files first to leverage Docker cache
COPY requirements.in requirements.in
COPY requirements.txt requirements.txt
# Install Python dependencies (as per the project's packaging strategy)
RUN python -m pip install --upgrade pip \
&& pip install -r requirements.in
# Copy the project sources
COPY . .
# Build and install the package from source
RUN python -m pip install .
# Cleanup build dependencies to keep the final image smaller
RUN apk del .build-deps
# Expose the CLI entrypoint defined in setup.py
ENTRYPOINT ["dirhunt"]
# Default to showing help if no arguments are provided
CMD ["--help"]
.git __pycache__/ *.pyc *.pyo *.pyd *.cache *.egg-info/ build/ dist/ *.egg-info/ *.tox/ *.venv/ venv/ env/ .env .env.* tests/ docs/_build/ *.log .coverage
.git __pycache__/ *.pyc *.pyo *.pyd *.cache *.egg-info/ build/ dist/ *.egg-info/ *.tox/ *.venv/ venv/ env/ .env .env.* tests/ docs/_build/ *.log .coverage
# General __pycache__/ *.pyc *.pyo *.pyd *.cache *.egg-info/ build/ dist/ *.egg-info/ *.tox/ *.venv/ venv/ env/ .env .env.* tests/ docs/_build/ *.log .pytest_cache/ *.coverage .coverage coverage.xml
Concerns: Python base image tag 3.14.5 may not exist in official Python images (3.11-3.13 are typical); this could cause build failure if the tag is invalid., The Dockerfile installs requirements.in but uses 'pip install -r requirements.in' while requirements.txt is copied but not used; ensure both are aligned or remove the unused file., No non-root user is created; running as root inside container is a security risk; consider adding a non-root user., COPY . . copies the entire repo; consider adding a .dockerignore to avoid copying large files (tests, local env), though not strictly wrong., The final image depends on setup.py to provide entrypoint; ensure setup.py defines console_scripts for 'dirhunt', otherwise the entrypoint may not be installed. Smoke [FAIL]: cd /app && pytest -q tests/smoke/ -x || (echo FAIL; exit 1) Output: FAIL sh: pytest: not found Smoke [FAIL]: cd /app && pytest -q -k \"not slow\" -x || (echo FAIL; exit 1) Output: FAIL sh: pytest: not found
Image python:3.12-alpine exists on Docker Hub.
FROM python:3.12-alpine
ENV PYTHONUNBUFFERED=1
# Install build tools and TLS dependencies
RUN set -eux; \
apk add --no-cache --virtual .build-deps build-base linux-headers openssl-dev zlib-dev libffi-dev ca-certificates; \
update-ca-certificates
WORKDIR /app
# Copy dependency specification files first to leverage Docker cache
COPY requirements.in requirements.in
COPY requirements.txt requirements.txt
# Install Python dependencies (as per the project's packaging strategy)
RUN python -m pip install --upgrade pip \
&& pip install -r requirements.in
# Copy the project sources
COPY . .
# Build and install the package from source
RUN python -m pip install .
# Cleanup build dependencies to keep the final image smaller
RUN apk del .build-deps
# Expose the CLI entrypoint defined in setup.py
ENTRYPOINT ["dirhunt"]
# Default to showing help if no arguments are provided
CMD ["--help"]
Concerns: The Dockerfile copies both requirements.in and requirements.txt but only 'pip install -r requirements.in' is invoked; if requirements.in doesn't cover all runtime dependencies, the installed package may fail at runtime. Consider aligning install steps to ensure dependencies are installed from requirements.txt or combine appropriately., No HEALTHCHECK is defined; adding a health check could help detect container readiness, but it's optional for CLI tools. Smoke [FAIL]: cd /app && pytest -q tests/smoke/ -x Output: sh: pytest: not found
FROM python:3.12-alpine
ENV PYTHONUNBUFFERED=1
# Build tools and TLS dependencies
RUN set -eux; \
apk add --no-cache --virtual .build-deps build-base linux-headers openssl-dev zlib-dev libffi-dev ca-certificates; \
update-ca-certificates
WORKDIR /app
# Copy dependency specification files first to leverage Docker cache
COPY requirements.txt requirements.txt
COPY requirements.in requirements.in
# Install Python dependencies (and pytest for smoke tests)
RUN python -m pip install --upgrade pip \
&& if [ -f requirements.txt ]; then pip install -r requirements.txt; fi \
&& if [ -f requirements.in ]; then pip install -r requirements.in; fi \
&& pip install pytest
# Copy the project sources
COPY . .
# Build and install the package from source
RUN python -m pip install .
# Cleanup build dependencies to keep the final image smaller
RUN apk del .build-deps
# Expose the CLI entrypoint defined in setup.py
ENTRYPOINT ["dirhunt"]
# Default to showing help if no arguments are provided
CMD ["--help"]
Status: build_failed
Concerns
- Smoke test may fail if dirhunt import relies on a distribution exposing only a console script.
- Pytest is installed in the final image, increasing image size.
Build error
- Failing step: [6/9] RUN python -m pip install --upgrade pip && if [ -f requirements.txt ]; then pip install -r requirements.txt; fi && if [ -f requirements.in ]; then pip install -r requirements.in; fi && pip install pytest
- Exact error (summary):
- Building wheels for collected packages: greenlet
- Building wheel for greenlet (pyproject.toml): started
- Building wheel for greenlet (pyproject.toml): finished with status 'error'
- error: subprocess-exited-with-error
- exit code: 1
- /tmp/pip-build-env-g3k2f2bg/overlay/lib/python3.12/site-packages/setuptools/dist.py:765: SetuptoolsDeprecationWarning: License classifiers are deprecated.
- src/greenlet/greenlet_greenlet.hpp:831:41: error: '_PyCFrame' {aka 'struct _PyCFrame'} has no member named 'use_tracing'
- src/greenlet/greenlet_greenlet.hpp:834:37: error: 'const PyThreadState' {aka 'const struct _ts'} has no member named 'recursion_limit'; did you mean 'py_recursion_limit'?
- src/greenlet/greenlet_greenlet.hpp:834:63: error: 'const PyThreadState' {aka 'const struct _ts'} has no member named 'recursion_remaining'; did you mean 'c_recursion_remaining'?
- src/greenlet/greenlet_greenlet.hpp:848:42: error: 'const PyThreadState' {aka 'const struct _ts'} has no member named 'trash_delete_nesting'
- ...; /usr/bin/g++' failed with exit code 1
- ERROR: Failed building wheel for greenlet
- ... → greenlet
- Missing packages or files:
- None explicitly missing; failure due to compiling greenlet against Python 3.12 (no compatible prebuilt wheel; API changes in PyThreadState/_PyCFrame)
- Version mismatch / environment details:
- Base image: python:3.12-alpine
- Greenlet cannot build a compatible wheel for Python 3.12; API changes in PyThreadState/_PyCFrame break compilation; no wheel available for Python 3.12; forced to build from source, which fails.
Actionable next steps
- Use a Python version compatible with available greenlet wheels (e.g., switch to python:3.11-alpine or similar).
- If you must stay on Python 3.12, pin greenlet to a version that supports 3.12 (if available) or apply patches/update to greenlet that address PyThreadState/_PyCFrame changes.
- Consider delaying Python 3.12 in the base image until greenlet support lands, or build with a non-alpine/predisposed image that has compatible wheels.
- Verify whether the smoke test can avoid importing dirhunt or delay pytest installation until after tooling conflicts are resolved.FROM python:3.11-alpine
ENV PYTHONUNBUFFERED=1
# Create a non-root user to run the application
RUN addgroup -S dirhunt && adduser -S -G dirhunt dirhunt
# Install build tools and TLS dependencies
RUN set -eux; \
apk add --no-cache --virtual .build-deps build-base linux-headers openssl-dev zlib-dev libffi-dev ca-certificates; \
update-ca-certificates
WORKDIR /app
# Copy dependency specification files first to leverage Docker cache
COPY requirements.in requirements.in
# Install Python dependencies (the project uses requirements.in for install_requires)
RUN python -m pip install --upgrade pip \
&& pip install -r requirements.in
# Copy the project sources
COPY . .
# Build and install the package from source
RUN python -m pip install .
# Cleanup build dependencies to keep the final image smaller
RUN apk del .build-deps
# Switch to a non-root user
USER dirhunt
# Expose the CLI entrypoint defined in setup.py
ENTRYPOINT ["dirhunt"]
# Default to showing help if no arguments are provided
CMD ["--help"]
Concerns: Relies on the repository having a tests/smoke/ suite; if the repo omits this, the smoke test may fail, Smoke tests rely on tests that do not require external network access; if tests perform network I/O, they may flake Smoke [FAIL]: cd /app && pytest -q tests/smoke/ -x Output: sh: pytest: not found
FROM python:3.11-alpine
ENV PYTHONUNBUFFERED=1
# Create a non-root user to run the application
RUN addgroup -S dirhunt && adduser -S -G dirhunt dirhunt
# Build tools and TLS dependencies
RUN set -eux; \
apk add --no-cache --virtual .build-deps build-base linux-headers openssl-dev zlib-dev libffi-dev ca-certificates; \
update-ca-certificates
WORKDIR /app
# Copy dependency specification files first to leverage Docker cache
COPY requirements.txt requirements.txt
COPY requirements.in requirements.in
# Install Python dependencies (the project uses requirements.in for install_requires)
RUN python -m pip install --upgrade pip \
&& pip install -r requirements.txt \
&& pip install -r requirements.in \
&& pip install pytest
# Copy the project sources
COPY . .
# Build and install the package from source
RUN python -m pip install .
# Cleanup build dependencies to keep the final image smaller
RUN apk del .build-deps
# Switch to a non-root user
USER dirhunt
# Expose the CLI entrypoint defined in setup.py
ENTRYPOINT ["dirhunt"]
# Default to showing help if no arguments are provided
CMD ["--help"]
Concerns: Smoke tests assume dirhunt prints discovered file paths to stdout; if output format differs, tests may fail., Final image installs pytest and build tools; could be trimmed for smaller size.
Smoke [FAIL]: mkdir -p /tmp/dirhunt-smoke; printf 'hello' > /tmp/dirhunt-smoke/hi.txt; dirhunt /tmp/dirhunt-smoke 2>&1 | grep -q '/tmp/dirhunt-smoke/hi.txt
Output: sh: syntax error: unterminated quoted string
Smoke [FAIL]: python -c 'import dirhunt; print("DIRHUNT_OK")' 2>&1 | grep -q 'DIRHUNT_OK
Output: sh: syntax error: unterminated quoted stringFROM python:3.11-alpine
ENV PYTHONUNBUFFERED=1
# Create a non-root user to run the application
RUN addgroup -S dirhunt && adduser -S -G dirhunt dirhunt
# Build tools and TLS dependencies
RUN set -eux; \
apk add --no-cache --virtual .build-deps build-base linux-headers openssl-dev zlib-dev libffi-dev ca-certificates bash; \
update-ca-certificates
WORKDIR /app
# Copy dependency specification files first to leverage Docker cache
COPY requirements.txt requirements.txt
COPY requirements.in requirements.in
# Install Python dependencies (the project uses requirements.in for install_requires)
RUN python -m pip install --upgrade pip \
&& pip install -r requirements.txt \
&& pip install -r requirements.in
# Copy the project sources
COPY . .
# Build and install the package from source
RUN python -m pip install .
# Cleanup build dependencies to keep the final image smaller
RUN apk del .build-deps
# Switch to a non-root user
USER dirhunt
# Expose the CLI entrypoint defined in setup.py
ENTRYPOINT ["dirhunt"]
# Default to showing help if no arguments are provided
CMD ["--help"]
Concerns: Final image likely loses CA certificates after apk del .build-deps, which can break TLS/SSL when the CLI performs HTTPS requests., Potentially heavy build dependencies are installed only to be removed later; consider validating that runtime TLS and core dependencies remain available., If dirhunt relies on a specific runtime permission or environment (e.g., non-root home, TLS cert store path), ensure the final image retains those resources.
Smoke [FAIL]: python -c 'import dirhunt, os; assert os.path.exists(dirhunt.__file__); print("DIRHUNT_LOADED")
Output: sh: syntax error: unterminated quoted stringFROM python:3.11-alpine
ENV PYTHONUNBUFFERED=1
# Create a non-root user to run the application
RUN addgroup -S dirhunt && adduser -S -G dirhunt dirhunt
# Build tools and TLS dependencies
RUN set -eux; \
apk add --no-cache --virtual .build-deps build-base linux-headers openssl-dev zlib-dev libffi-dev ca-certificates bash; \
update-ca-certificates
WORKDIR /app
# Copy dependency specification files first to leverage Docker cache
COPY requirements.txt requirements.txt
COPY requirements.in requirements.in
# Install Python dependencies
RUN python -m pip install --upgrade pip \
&& pip install -r requirements.txt \
&& pip install -r requirements.in
# Copy the project sources
COPY . .
# Build and install the package from source
RUN python -m pip install .
# Cleanup build dependencies to keep the final image smaller
RUN apk del .build-deps
# Switch to a non-root user
USER dirhunt
# Expose the CLI entrypoint defined in setup.py
ENTRYPOINT ["dirhunt"]
# Default to showing help if no arguments are provided
CMD ["--help"]
Concerns: The repo may not include a smoke test suite at tests/smoke/; pytest on that path could fail even if the app works, depending on repository layout., The Dockerfile builds from source and installs many build dependencies; ensure this aligns with CI resource constraints and security policies.
Smoke [FAIL]: pytest -q tests/smoke/ -x
Output: sh: pytest: not found
Smoke [FAIL]: python -c "import dirhunt, sys; print('ok')
Output: sh: syntax error: unterminated quoted stringFROM python:3.11-alpine
ENV PYTHONUNBUFFERED=1
# Create a non-root user to run the application
RUN addgroup -S dirhunt && adduser -S -G dirhunt dirhunt
# Build tools and TLS dependencies
RUN set -eux; \
apk add --no-cache --virtual .build-deps build-base linux-headers openssl-dev zlib-dev libffi-dev ca-certificates bash; \
update-ca-certificates
WORKDIR /app
# Copy dependency specification files first to leverage Docker cache
COPY requirements.txt requirements.txt
COPY requirements.in requirements.in
# Install Python dependencies
RUN python -m pip install --upgrade pip \
&& pip install -r requirements.txt \
&& pip install -r requirements.in \
&& pip install pytest
# Copy the project sources
COPY . .
# Build and install the package from source
RUN python -m pip install .
# Cleanup build dependencies to keep the final image smaller
RUN apk del .build-deps
# Switch to a non-root user
USER dirhunt
# Expose the CLI entrypoint defined in setup.py
ENTRYPOINT ["dirhunt"]
# Default to showing help if no arguments are provided
CMD ["--help"]
Concerns: Final image will likely be missing CA certificates after 'apk del .build-deps', which can cause TLS connections (e.g., to PyPI or remote endpoints) to fail at runtime., pytest is installed into the runtime environment; this inflates the final image and isn't needed for typical CLI runtime., If the project relies on TLS or external endpoints during CLI operation, the missing certs could cause functional failures in smoke tests.
Smoke [FAIL]: pytest -q tests/smoke -x
Output:
=============================== warnings summary ===============================
../usr/local/lib/python3.11/site-packages/_pytest/cacheprovider.py:475
/usr/local/lib/python3.11/site-packages/_pytest/cacheprovider.py:475: PytestCacheWarning: could not create cache path /app/.pytest_cache/v/cache/nodeids: [Errno 13] Permission denied: '/app/pytest-cache-files-ubqvl9zr'
config.cache.set("cache/nodeids", sorted(self.cached_nodeids))
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-
Smoke [FAIL]: pytest -q tests -k smoke -x
Output:
=============================== warnings summary ===============================
../usr/local/lib/python3.11/site-packages/_pytest/cacheprovider.py:475
/usr/local/lib/python3.11/site-packages/_pytest/cacheprovider.py:475: PytestCacheWarning: could not create cache path /app/.pytest_cache/v/cache/nodeids: [Errno 13] Permission denied: '/app/pytest-cache-files-_8wf9kle'
config.cache.set("cache/nodeids", sorted(self.cached_nodeids))
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-FROM python:3.11-alpine
ENV PYTHONUNBUFFERED=1
# Create a non-root user to run the application
RUN addgroup -S dirhunt && adduser -S -G dirhunt dirhunt
# Build tools and TLS dependencies
RUN set -eux; \
apk add --no-cache --virtual .build-deps build-base linux-headers openssl-dev zlib-dev libffi-dev ca-certificates bash; \
update-ca-certificates
# Prepare app directory with correct permissions
RUN mkdir -p /home/dirhunt/app && chown -R dirhunt:dirhunt /home/dirhunt
WORKDIR /home/dirhunt/app
# Copy dependency specification files first to leverage Docker cache
COPY requirements.txt requirements.txt
COPY requirements.in requirements.in
# Install Python dependencies
RUN python -m pip install --upgrade pip \
&& pip install -r requirements.txt \
&& pip install -r requirements.in
# Copy the project sources
COPY . .
# Build and install the package from source
RUN python -m pip install .
# Cleanup build dependencies to keep the final image smaller
# (keep CA certificates; do not remove them to avoid TLS issues)
# RUN apk del .build-deps
# Switch to a non-root user
USER dirhunt
# Expose the CLI entrypoint defined in setup.py
ENTRYPOINT ["dirhunt"]
# Default to showing help if no arguments are provided
CMD ["--help"]
Concerns: Build artifacts are not cleaned up: the final image does not run 'apk del .build-deps', leaving heavy build dependencies in the runtime image., Copying both requirements.txt and requirements.in and installing both may be redundant or cause conflicts if versions differ; ensure this is intentional and well-managed., No explicit test/run of the built CLI in the Dockerfile beyond installation; if the repo lacks a proper smoke/integration script, you may want to add one to validate the binary in CI. Smoke [FAIL]: cd /home/dirhunt/app && pytest -q tests/smoke/ -x Output: sh: pytest: not found
FROM python:3.11-alpine
ENV PYTHONUNBUFFERED=1
# Create a non-root user to run the application
RUN addgroup -S dirhunt && adduser -S -G dirhunt dirhunt
# Build tools and TLS dependencies
RUN set -eux; \
apk add --no-cache --virtual .build-deps build-base linux-headers openssl-dev zlib-dev libffi-dev ca-certificates bash; \
update-ca-certificates
# Prepare app directory with correct permissions
RUN mkdir -p /home/dirhunt/app && chown -R dirhunt:dirhunt /home/dirhunt
WORKDIR /home/dirhunt/app
# Copy dependency specification files first to leverage Docker cache
COPY requirements.txt requirements.txt
COPY requirements.in requirements.in
# Install Python dependencies (and pytest for smoke tests)
RUN python -m pip install --upgrade pip \
&& if [ -f requirements.txt ]; then pip install -r requirements.txt; fi \
&& if [ -f requirements.in ]; then pip install -r requirements.in; fi \
&& pip install pytest
# Copy the project sources
COPY . .
# Build and install the package from source
RUN python -m pip install .
# Cleanup build dependencies to keep the final image smaller
RUN apk del .build-deps
# Switch to a non-root user
USER dirhunt
# Expose the CLI entrypoint defined in setup.py
ENTRYPOINT ["dirhunt"]
# Default to showing help if no arguments are provided
CMD ["--help"]
Concerns: COPY . . copies the entire repository into the image; consider adding a .dockerignore to avoid shipping tests, local configs, or large files., Build-time dependencies are removed after install, but ensure runtime dependencies required by the package are preserved (e.g., certs, libraries)., Relying on setup.py/entrypoints assumes an entry point named 'dirhunt' is defined; if the packaging metadata changes, the container startup could fail.
Smoke [FAIL]: python -c "import dirhunt; f = getattr(dirhunt, '__file__', None); assert f is not None; print('ok')
Output: sh: syntax error: unterminated quoted stringFROM python:3.12-alpine
# Prevent Python from writing pyc files to disk
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# Install build dependencies and CA certificates
RUN apk add --no-cache --virtual .build-deps \
build-base \
linux-headers \
openssl-dev \
zlib-dev \
libffi-dev \
&& apk add --no-cache ca-certificates
# Upgrade pip
RUN python -m pip install --upgrade pip
# Install runtime dependencies first to leverage Docker layer caching
COPY requirements.txt .
RUN pip install -r requirements.txt
# Copy the source and install the package from source
COPY . .
RUN python -m pip install .
# Strip build dependencies to reduce image size
RUN apk del .build-deps
# Create a non-root user and switch to it for security
RUN adduser -D dirhunt
USER dirhunt
# Set a simple default command to display help
ENTRYPOINT ["dirhunt"]
CMD ["--help"]
# Exclude VCS and build outputs .git .gitignore __pycache__/ **/__pycache__/ *.pyc build/ dist/ *.egg-info/ .eggs/ .eggs-info/ tox/ *.log __pycache__ docs/ tests/ dirhunt/tests/ .cache/ *.pytest_cache/ env/ venv/
- Failing step: [ 6/10] RUN pip install -r requirements.txt
- Dockerfile reference: Dockerfile:23
- Exact error trace (preserve):
- Building wheels for collected packages: greenlet
- Building wheel for greenlet (pyproject.toml): started
- Building wheel for greenlet (pyproject.toml): finished with status 'error'
- error: subprocess-exited-with-error
- × Building wheel for greenlet (pyproject.toml) did not run successfully.
- exit code: 1
- ... (snip of long log)
- /usr/bin/g++' failed with exit code 1
- Failed building wheel for greenlet
- ERROR: Failed building wheel for greenlet
- process "/bin/sh -c pip install -r requirements.txt" did not complete successfully: exit code: 1
- Failing command / step details:
- Failing command: RUN pip install -r requirements.txt
- Dockerfile reference: Dockerfile:23 (step shows as [ 6/10] RUN pip install -r requirements.txt)
- Missing packages or files mentioned:
- No missing file/package messages reported. The failure stems from compiling the greenlet wheel. The requirements.txt includes greenlet==2.0.2, which is implicated.
- Version mismatch / compatibility info:
- The errors during building greenlet indicate a compatibility issue with Python 3.12 in this Alpine image:
- PyThreadState fields that do not exist in Python 3.12 (e.g., use_tracing, recursion_limit, recursion_remaining, trash_delete_nesting).
- This suggests greenlet 2.0.2 is not compatible with Python 3.12 (in this build environment).
- Likely fixes (actionable):
- Use a Python version compatible with greenlet 2.0.2 (e.g., Python <= 3.11), or
- Upgrade greenlet to a version that supports Python 3.12 (if available).FROM python:3.11-alpine
# Prevent Python from writing pyc files to disk
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# Install build dependencies and CA certificates
RUN apk add --no-cache --virtual .build-deps \
build-base \
linux-headers \
openssl-dev \
zlib-dev \
libffi-dev \
&& apk add --no-cache ca-certificates
# Upgrade pip
RUN python -m pip install --upgrade pip
# Install runtime dependencies first to leverage Docker layer caching
COPY requirements.txt .
RUN pip install -r requirements.txt
# Copy the source and install the package from source
COPY . .
RUN python -m pip install .
# Strip build dependencies to reduce image size
RUN apk del .build-deps
# Create a non-root user and switch to it for security
RUN adduser -D dirhunt
USER dirhunt
# Set a simple default command to display help
ENTRYPOINT ["dirhunt"]
CMD ["--help"]
Concerns: Smoke tests could be stronger by exercising a real CLI path (e.g., a non-network, local input) rather than only ensuring the Python package can be imported., No explicit health-check or example-end-to-end test is included; if the project ships an official smoke or test script, it should be used.
Smoke [FAIL]: python -c 'import importlib; mod = importlib.import_module("dirhunt"); assert hasattr(mod, "__file__"); print("ok")
Output: sh: syntax error: unterminated quoted stringFROM python:3.11-alpine
# Prevent Python from writing pyc files to disk
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# Install build dependencies and CA certificates
RUN apk add --no-cache --virtual .build-deps \
build-base \
linux-headers \
openssl-dev \
zlib-dev \
libffi-dev \
&& apk add --no-cache ca-certificates
# Upgrade pip
RUN python -m pip install --upgrade pip
# Install runtime dependencies first to leverage Docker layer caching
COPY requirements.txt .
RUN pip install -r requirements.txt
# Copy the source and install the package from source
COPY . .
RUN python -m pip install .
# Strip build dependencies to reduce image size
RUN apk del .build-deps
# Create a non-root user? Use root for compatibility with package installation and tests
# USER dirhunt
# Set a simple default command to display help
ENTRYPOINT ["dirhunt"]
CMD ["--help"]
# Healthcheck to verify container is running and importable
HEALTHCHECK --interval=30s --timeout=5s CMD python -c "import dirhunt, sys; print(dirhunt.__version__ if hasattr(dirhunt,'__version__') else 'ok')" || exit 1
Concerns: The healthcheck assumes dirhunt can be imported; if import triggers heavy optional dependencies, healthcheck may fail even when the binary itself is fine., Smoke tests rely on the repo containing a tests/smoke/ suite; if that path is missing, the pytest smoke test will fail. Smoke [FAIL]: pytest -q tests/smoke/ -x Output: sh: pytest: not found Smoke [FAIL]: python -c 'import dirhunt; print(dirhunt.__name__) Output: sh: syntax error: unterminated quoted string
FROM python:3.11-alpine
# Prevent Python from writing pyc files to disk
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# Install build dependencies and CA certificates
RUN apk add --no-cache --virtual .build-deps \
build-base \
linux-headers \
openssl-dev \
zlib-dev \
libffi-dev \
&& apk add --no-cache ca-certificates
# Upgrade pip
RUN python -m pip install --upgrade pip
# Install runtime dependencies first to leverage Docker layer caching
COPY requirements.txt .
RUN pip install -r requirements.txt
# Install pytest for smoke tests in the final image
RUN pip install pytest
# Copy the source and install the package from source
COPY . .
RUN python -m pip install .
# Strip build dependencies to reduce image size
RUN apk del .build-deps
# Create a non-root user and switch to it for security
RUN adduser -D dirhunt
USER dirhunt
# Set a simple default command to display help
ENTRYPOINT ["dirhunt"]
CMD ["--help"]
Concerns: pytest is installed in the final image (unusual and increases image size) but acceptable for smoke tests; consider moving to a separate test image or using a lightweight test runner., No explicit HEALTHCHECK defined (not required for smoke test but recommended for production readiness). Smoke [PASS]: pytest -q