-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10444a7
commit 00f20a0
Showing
1 changed file
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |