# Dockerfile.ci — CI/release image using pre-built binaries.
# Used by release workflows to skip the ~60 min Rust compilation.
# The main Dockerfile is still used for local dev builds.

# ── Runtime (Distroless) ─────────────────────────────────────
FROM gcr.io/distroless/cc-debian13:nonroot@sha256:84fcd3c223b144b0cb6edc5ecc75641819842a9679a3a58fd6294bec47532bf7

ARG TARGETARCH

# Copy the pre-built binary for this platform (amd64 or arm64)
COPY bin/${TARGETARCH}/construct /usr/local/bin/construct

# Runtime directory structure and default config
COPY --chown=65534:65534 construct-data/ /construct-data/

ENV LANG=C.UTF-8
ENV CONSTRUCT_WORKSPACE=/construct-data/workspace
ENV HOME=/construct-data
ENV CONSTRUCT_GATEWAY_PORT=42617

WORKDIR /construct-data
USER 65534:65534
EXPOSE 42617
ENTRYPOINT ["construct"]
CMD ["gateway"]
