Add a dedicated `eirescope` user (UID 1000) and chown /app to it so the image no longer runs as root. Drop flask and sqlalchemy from requirements.txt — neither is imported anywhere; the server uses stdlib http.server and raw sqlite3. Add jinja2 explicitly (it was previously a transitive of Flask) and pin upper bounds on every dep so builds are at least somewhat reproducible.
24 lines
569 B
Docker
24 lines
569 B
Docker
FROM python:3.11-slim
|
|
|
|
# System dependencies for OSINT modules (whois lookups, DNS queries)
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends whois dnsutils && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN useradd --create-home --shell /bin/bash --uid 1000 eirescope
|
|
|
|
WORKDIR /app
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY . .
|
|
|
|
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
|
RUN chmod +x /docker-entrypoint.sh && chown -R eirescope:eirescope /app
|
|
|
|
USER eirescope
|
|
|
|
EXPOSE 5000
|
|
|
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|