diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cc24f2f --- /dev/null +++ b/Dockerfile @@ -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"] diff --git a/src/service/network.ts b/src/service/network.ts index 8cde6c6..a9aba08 100644 --- a/src/service/network.ts +++ b/src/service/network.ts @@ -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 }; }