Skip to content

Commit

Permalink
Merge pull request #58 from oceanprotocol/feature/optimize_docker_size
Browse files Browse the repository at this point in the history
optimize docker size
  • Loading branch information
alexcos20 authored Aug 15, 2023
2 parents a4ade45 + ea20bf1 commit 9789dd0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
23 changes: 18 additions & 5 deletions Dockerfile
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
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
"got": "^10.2.1",
"pg": "^7.17.1",
"pg-pool": "^2.0.9",
"release-it": "^14.6.1",
"stream": "0.0.2",
"util": "^0.12.1",
"web3": "^1.7.0"
"web3": "^1.7.0",
"truffle-privatekey-provider": "^1.3.0"
},
"devDependencies": {
"eslint": "^6.7.2",
"eslint-config-oceanprotocol": "^1.5.0",
"eslint-config-prettier": "^6.7.0",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"truffle-privatekey-provider": "^1.3.0"
"release-it": "^14.6.1"
}
}

0 comments on commit 9789dd0

Please sign in to comment.