FROM python:3.14-alpine3.23
# Create a non-root user for running the application
RUN adduser -D appuser
WORKDIR /app
# Copy the repository source
COPY . /app
# Build/runtime dependencies (TLS library bindings)
RUN apk add --no-cache --virtual .build-deps build-base libffi-dev openssl-dev
RUN pip install --no-cache-dir tlslite-ng ecdsa
# Clean up build dependencies to keep image small
RUN apk del .build-deps
# Ensure runtime user owns the app directory
RUN chown -R appuser:appuser /app
USER appuser
CMD ["python3", "cscan.py"]