Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
Change dockerfile to make compatible with collectors
Browse files Browse the repository at this point in the history
  • Loading branch information
Gonzalo Avalos Ribas authored and Gonzalo Avalos Ribas committed Apr 8, 2024
1 parent e366dea commit d18b939
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
FROM node:18-bullseye-slim as builder
FROM node:18-alpine

ENV JUPITERONE_INTEGRATION_DIR=/opt/jupiterone/integration

COPY package.json yarn.lock tsconfig.dist.json tsconfig.json LICENSE ${JUPITERONE_INTEGRATION_DIR}/
COPY package.json yarn.lock tsconfig.json LICENSE ${JUPITERONE_INTEGRATION_DIR}/
COPY src/ ${JUPITERONE_INTEGRATION_DIR}/src
WORKDIR ${JUPITERONE_INTEGRATION_DIR}
RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/api/lists/*
RUN yarn install
RUN yarn build:docker


FROM node:18-bullseye-slim
ENV JUPITERONE_INTEGRATION_DIR=/opt/jupiterone/integration
COPY --from=builder --chown=node:node ${JUPITERONE_INTEGRATION_DIR}/dist ${JUPITERONE_INTEGRATION_DIR}
COPY --from=builder --chown=node:node ${JUPITERONE_INTEGRATION_DIR}/yarn.lock ${JUPITERONE_INTEGRATION_DIR}
COPY scripts/ ${JUPITERONE_INTEGRATION_DIR}/scripts
WORKDIR ${JUPITERONE_INTEGRATION_DIR}
RUN apt-get update && apt-get install -y python3
RUN yarn install --production --fronzen-lockfile --cache-folder ./ycache && yarn global add --cache-folder ./ycache @jupiterone/integration-sdk-cli && rm -rf ./ycache && chown -R node:node /opt/jupiterone
RUN export PATH="$(yarn global bin):$PATH"

USER node
RUN yarn install

CMD ["sh", "scripts/execute.sh"]
ENTRYPOINT /usr/local/bin/yarn j1-integration run -i ${INTEGRATION_INSTANCE_ID} --disable-schema-validation --api-base-url ${JUPITERONE_API_BASE_URL:-https://api.us.jupiterone.io} --account ${JUPITERONE_ACCOUNT} --api-key ${JUPITERONE_API_KEY}

0 comments on commit d18b939

Please sign in to comment.