Skip to content

Commit

Permalink
Update Dockerfile-explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyfilyanin authored Oct 11, 2023
1 parent 10444a7 commit 00f20a0
Showing 1 changed file with 38 additions and 5 deletions.
43 changes: 38 additions & 5 deletions Dockerfile-explorer
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
FROM node:18-alpine

RUN npm i -g @subsquid/cli@latest
FROM node:16-alpine AS node
FROM node AS node-with-gyp
RUN apk add g++ make python3
FROM node-with-gyp AS builder
WORKDIR /squid
ADD package.json .
ADD package-lock.json .
# remove if needed
ADD assets assets
# remove if needed
ADD db db
# remove if needed
ADD schema.graphql .
RUN npm ci
ADD tsconfig.json .
ADD src src
RUN npm run build
FROM node-with-gyp AS deps
WORKDIR /squid
ADD package.json .
ADD package-lock.json .
RUN npm ci --production
FROM node AS squid
WORKDIR /squid
COPY --from=deps /squid/package.json .
COPY --from=deps /squid/package-lock.json .
COPY --from=deps /squid/node_modules node_modules
COPY --from=builder /squid/lib lib
# remove if no assets folder
COPY --from=builder /squid/assets assets
# remove if no db folder
COPY --from=builder /squid/db db
# remove if no schema.graphql is in the root
COPY --from=builder /squid/schema.graphql schema.graphql
# remove if no commands.json is in the root
ADD commands.json .
RUN echo -e "loglevel=silent\\nupdate-notifier=false" > /squid/.npmrc
RUN npm i -g @subsquid/commands && mv $(which squid-commands) /usr/local/bin/sqd

CMD ["sqd", "serve:prod"]
ENV PROCESSOR_PROMETHEUS_PORT 3000

0 comments on commit 00f20a0

Please sign in to comment.