Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dockerfile #114

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:16-alpine
WORKDIR /usr/src/app

RUN apk add pkgconfig cairo-dev pango-dev libjpeg giflib-dev librsvg-dev pixman-dev g++ make py3-pip

COPY package.json yarn.lock tsconfig.json ./
COPY ./src ./src

RUN yarn install
RUN yarn build

RUN yarn install --production
RUN apk del g++ make py3-pip

EXPOSE 8080
CMD ["yarn", "start"]
2 changes: 2 additions & 0 deletions src/service/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export default function getNetwork(network: string): any {
default:
throw new UnsupportedNetwork(`Unknown network '${network}'`, 400);
}
process.env.RPC_PROVIDER && (CLOUDFLARE_WEB3_URL = process.env.RPC_PROVIDER);
process.env.SUBGRAPH_URL && (SUBGRAPH_URL = process.env.SUBGRAPH_URL);
const provider = new ethers.providers.StaticJsonRpcProvider(CLOUDFLARE_WEB3_URL);
return { CLOUDFLARE_WEB3_URL, SUBGRAPH_URL, provider };
}