FROM ubuntu:24.04

RUN apt-get update \
    && apt-get install --yes --no-install-recommends libpq5 ca-certificates \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Copy PyInstaller binary
COPY dist/ntapinsight_collector /app/ntapinsight-collector

# Ensure directories exist in case volumes are not mounted yet
RUN mkdir -p /app/config /app/license /app/logs \
    && chmod +x /app/ntapinsight-collector

ENTRYPOINT ["/app/ntapinsight-collector"]
