Skip to content

Commit

Permalink
dockerfile points to fixed opa exec
Browse files Browse the repository at this point in the history
  • Loading branch information
Ptroger committed Sep 6, 2024
1 parent 02fb396 commit 2aec6e9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions deploy/policy-engine.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ FROM node:21 as build
WORKDIR /usr/src/app

# Install the OPA binary, which we'll need to actually run evals
RUN curl -L -o opa https://openpolicyagent.org/downloads/v0.64.1/opa_linux_amd64_static && \
RUN curl -L -o opa https://raw.githubusercontent.com/Ptroger/opa-bugfix-build/main/opa && \
chmod 755 opa && \
mv opa /usr/local/bin/opa && \
opa version

COPY package*.json ./
COPY .npmrc ./

# Update npm
RUN npm install -g npm@latest

RUN npm ci && npm cache clean --force


# Copy the local code to the container's workspace.
COPY packages ./packages
COPY apps ./apps
Expand All @@ -35,8 +39,6 @@ COPY ./deploy/db-migrator.sh .
RUN chmod +x ./db-migrator.sh

# Copy built application and node_modules
# We need node_modules to run the application and it's more efficient to copy the whole thing from the previous step
# rather than installing it again, even though this includes devDependencies b/c it can use the cache to speed up builds unless deps change.
COPY --from=build /usr/src/app/dist ./dist
COPY --from=build /usr/src/app/node_modules ./node_modules
COPY --from=build /usr/local/bin/opa /usr/local/bin/opa
Expand All @@ -47,5 +49,4 @@ ENV PORT=3010
ENV RESOURCE_PATH=/usr/src/app/dist/apps/policy-engine/resource

EXPOSE 3010
CMD ["node", "dist/apps/policy-engine/main.js"]

CMD ["node", "dist/apps/policy-engine/main.js"]

0 comments on commit 2aec6e9

Please sign in to comment.