39 lines
1.1 KiB
Docker
39 lines
1.1 KiB
Docker
#######################################
|
|
FROM alpine:3.22 AS cloner
|
|
RUN apk add --no-cache git; \
|
|
git clone https://github.com/Ground-Zerro/DomainMapper.git
|
|
COPY files/custom-dns-list.txt /DomainMapper/custom-dns-list.txt
|
|
COPY files/config.ini /DomainMapper/config.ini
|
|
|
|
|
|
#######################################
|
|
FROM python:3.12-alpine AS pydeps
|
|
WORKDIR /app
|
|
COPY --from=cloner /DomainMapper/requirements.txt .
|
|
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/
|
|
RUN uv pip install --target /python -r requirements.txt
|
|
|
|
|
|
#######################################
|
|
#FROM gcr.io/distroless/python3-debian12:debug
|
|
FROM gcr.io/distroless/python3-debian12
|
|
#FROM al3xos/python-distroless:3.13-debian12
|
|
|
|
WORKDIR /app
|
|
|
|
# Ensure Python finds vendored site-packages and unbuffered output
|
|
ENV PYTHONPATH=/python
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV PYTHONUTF8=1
|
|
ENV LANG=C.UTF-8
|
|
ENV LC_ALL=C.UTF-8
|
|
|
|
# Copy application code
|
|
COPY --from=cloner --chown=65532:65532 /DomainMapper /app
|
|
|
|
# Copy vendored Python dependencies
|
|
COPY --from=pydeps --chown=65532:65532 /python /python
|
|
|
|
# No shell or package manager available in distroless
|
|
ENTRYPOINT ["python3", "main.py"]
|