-
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.
Merge pull request #58 from oceanprotocol/feature/optimize_docker_size
optimize docker size
- Loading branch information
Showing
2 changed files
with
21 additions
and
8 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,15 +1,28 @@ | ||
FROM node:12 | ||
FROM ubuntu:20.04 as base | ||
RUN apt-get update && apt-get -y install bash curl | ||
RUN curl -sL https://deb.nodesource.com/setup_16.x -o /tmp/nodesource_setup.sh | ||
RUN bash /tmp/nodesource_setup.sh | ||
RUN apt install nodejs | ||
|
||
COPY package*.json ./ | ||
RUN npm install | ||
|
||
COPY . . | ||
|
||
FROM base as builder | ||
RUN apt-get update && apt-get -y install wget | ||
COPY package*.json /usr/src/app/ | ||
WORKDIR /usr/src/app/ | ||
ENV NODE_ENV=production | ||
RUN npm ci | ||
|
||
FROM base as runner | ||
ENV NODE_ENV=production | ||
COPY . /usr/src/app | ||
WORKDIR /usr/src/app/ | ||
COPY --from=builder /usr/src/app/node_modules/ /usr/src/app/node_modules/ | ||
ENTRYPOINT node src/index.js \ | ||
--workflow "$WORKFLOW" \ | ||
--node "$NODE" \ | ||
--credentials "$CREDENTIALS" \ | ||
--password "$PASSWORD" \ | ||
--path "$VOLUME" \ | ||
--verbose \ | ||
# > "$VOLUME/pod-configuration-logs.txt" | tee file | ||
# > "$VOLUME/pod-configuration-logs.txt" | tee file |
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