FROM node:22-alpine

WORKDIR /app

COPY package.json package-lock.json ./
COPY packages ./packages
COPY services/device-gateway ./services/device-gateway
COPY services/device-control-core/package.json ./services/device-control-core/package.json

RUN npm ci --omit=dev --ignore-scripts

USER node

CMD ["node", "services/device-gateway/src/server.mjs"]
