ARG DECISION_CENTER_BASE_IMAGE=oven/bun:1-debian
FROM ${DECISION_CENTER_BASE_IMAGE}

WORKDIR /app/src/components/microservices/decision-center
RUN apt-get update \
  && apt-get install -y --no-install-recommends git openssh-client ca-certificates tini \
  && apt-get clean \
  && rm -rf /var/lib/apt/lists/*
COPY src/components/microservices/decision-center/package.json ./package.json
RUN bun install --production
COPY src/components/microservices/decision-center/tsconfig.json ./tsconfig.json
COPY src/components/shared /app/src/components/shared
COPY src/components/microservices/decision-center/src ./src

EXPOSE 4277
ENTRYPOINT ["tini", "--"]
CMD ["bun", "run", "src/index.ts"]
