FROM debian:trixie-slim

ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /app

RUN apt-get update && \
    apt-get install -y --no-install-recommends ipmitool freeipmi-tools openssh-client sshpass ca-certificates && \
    rm -rf /var/lib/apt/lists/*

COPY VERSION README.md ./
COPY contracts/ ./contracts/
COPY web/ ./web/
COPY config/ ./config/
COPY build/native/stl_native_server /usr/local/bin/stl_native_server

ARG STL_BUILD_COMMIT=vd012-native
ARG STL_VERSION=0.8.1.21
ENV STL_BUILD_COMMIT=${STL_BUILD_COMMIT} \
    STL_VERSION=${STL_VERSION}

EXPOSE 8080 69/udp
CMD ["/usr/local/bin/stl_native_server", "--config", "/app/config/station0-live.json", "--web-listen", "0.0.0.0:8080", "--tftp-listen", "0.0.0.0:69", "--data-dir", "/app/data", "--web-dir", "/app/web", "--contracts", "/app/contracts/firmware-vd012.json"]
