-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update docker to build from source (#85)
- Loading branch information
1 parent
1bb935b
commit 81428b7
Showing
2 changed files
with
59 additions
and
18 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
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,14 +1,19 @@ | ||
# production images | ||
FROM node:18 as builder | ||
ARG RELEASE_VERSION | ||
ENTRYPOINT ["subql-node-algorand"] | ||
RUN npm i -g --unsafe-perm @subql/node-algorand@${RELEASE_VERSION} | ||
# Build stage | ||
FROM node:18-alpine as builder | ||
WORKDIR /app | ||
COPY ./packages/node ./ | ||
RUN npm install -g --force yarn@latest && \ | ||
yarn pack --filename app.tgz && \ | ||
rm -rf /root/.npm /root/.cache | ||
|
||
# Production stage | ||
FROM node:18-alpine | ||
ENV TZ utc | ||
|
||
RUN apk add --no-cache tini git curl | ||
COPY --from=builder /usr/local/lib/node_modules /usr/local/lib/node_modules | ||
|
||
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/lib/node_modules/@subql/node-algorand/bin/run"] | ||
CMD ["-f","/app"] | ||
RUN apk add --no-cache tini curl git | ||
COPY --from=builder /app/app.tgz /app.tgz | ||
RUN tar -xzvf /app.tgz --strip 1 && \ | ||
rm /app.tgz && \ | ||
yarn install --production && \ | ||
yarn cache clean && \ | ||
rm -rf /root/.npm /root/.cache | ||
ENTRYPOINT ["/sbin/tini", "--", "bin/run"] | ||
CMD ["-f","/app"] |