ARG ARCANE_RUNTIME_BASE_IMAGE=ghcr.io/getarcaneapp/base:distroless
FROM ${ARCANE_RUNTIME_BASE_IMAGE}

ARG TARGETPLATFORM

WORKDIR /app

COPY ${TARGETPLATFORM}/arcane ./arcane

ENV ARCANE_ENVIRONMENT=production
ENV ARCANE_PORT=3552

# The container starts as "root", but arcane drops to the requetsed PUID and PGID after the runtime is initialized 
USER 0:0

ENV PATH="/app:$PATH"
EXPOSE 3552
VOLUME ["/app/data"]

CMD ["./arcane"]
