reduce docker siz (#709)

This commit is contained in:
Alex Coseru 2023-08-15 15:00:25 +03:00 committed by GitHub
parent bc56752f3c
commit fa58272978
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 9 deletions

View File

@ -1,9 +1,24 @@
FROM node:16
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
FROM base as builder
RUN apt-get update && apt-get -y install wget
COPY package*.json /usr/src/app/
WORKDIR /usr/src/app
RUN npm install
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/
ENV DEPLOY_SUBGRAPH=true
ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh"]

View File

@ -46,8 +46,6 @@
"changelog": "auto-changelog -p"
},
"devDependencies": {
"@graphprotocol/graph-cli": "^0.38.0",
"@graphprotocol/graph-ts": "^0.30.0",
"@types/chai": "^4.3.5",
"@types/chai-spies": "^1.0.3",
"@types/mocha": "^10.0.1",
@ -71,14 +69,16 @@
"ts-node": "^10.9.1",
"ts-node-dev": "^2.0.0",
"ts-node-register": "^1.0.0",
"typescript": "^5.0.4"
},
"dependencies": {
"@oceanprotocol/contracts": "^1.1.14",
"typescript": "^5.0.4",
"@oceanprotocol/lib": "^2.7.0",
"cross-fetch": "^3.1.6",
"ethereumjs-util": "^7.1.5"
},
"dependencies": {
"@oceanprotocol/contracts": "^1.1.14",
"@graphprotocol/graph-cli": "^0.38.0",
"@graphprotocol/graph-ts": "^0.30.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/oceanprotocol/ocean-subgraph.git"