-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added dockerfiles + some logic changes
- Loading branch information
Federico Sebaste
committed
Jan 19, 2023
1 parent
0b93b23
commit 74dd025
Showing
9 changed files
with
906 additions
and
279 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM node:16-alpine | ||
|
||
RUN apk add --no-cache libc6-compat git | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN yarn install --frozen-lockfile | ||
|
||
CMD [ "yarn", "dev" ] |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM alpine:3.16 AS builder | ||
WORKDIR /opt | ||
RUN apk add clang lld curl build-base linux-headers git \ | ||
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh \ | ||
&& chmod +x ./rustup.sh \ | ||
&& ./rustup.sh -y | ||
RUN git clone https://github.com/foundry-rs/foundry.git | ||
# && cd foundry \ | ||
# && git reset --hard b554ab1fec09087fa3a35c6728968edca6debcf2 | ||
WORKDIR /opt/foundry | ||
RUN source $HOME/.profile && cargo build --release \ | ||
&& strip /opt/foundry/target/release/forge \ | ||
&& strip /opt/foundry/target/release/cast \ | ||
&& strip /opt/foundry/target/release/anvil | ||
|
||
FROM alpine:3.16 AS client | ||
ENV GLIBC_KEY=https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub | ||
ENV GLIBC_KEY_FILE=/etc/apk/keys/sgerrand.rsa.pub | ||
ENV GLIBC_RELEASE=https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-2.35-r0.apk | ||
|
||
RUN apk add linux-headers gcompat git | ||
RUN wget -q -O ${GLIBC_KEY_FILE} ${GLIBC_KEY} \ | ||
&& wget -O glibc.apk ${GLIBC_RELEASE} \ | ||
&& apk add glibc.apk --force | ||
COPY --from=builder /opt/foundry/target/release/forge /usr/local/bin/forge | ||
COPY --from=builder /opt/foundry/target/release/cast /usr/local/bin/cast | ||
COPY --from=builder /opt/foundry/target/release/anvil /usr/local/bin/anvil | ||
RUN adduser -Du 1000 foundry | ||
|
||
EXPOSE 8545 | ||
|
||
ENTRYPOINT ["/bin/sh", "-c"] |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Install all deps | ||
FROM node:16-alpine AS deps | ||
RUN apk add --no-cache libc6-compat git | ||
WORKDIR /app | ||
COPY package.json yarn-lock.json* ./ | ||
COPY . . | ||
RUN yarn install --frozen-lockfile | ||
|
||
# Build app | ||
FROM node:16-alpine AS builder | ||
WORKDIR /app | ||
COPY --from=deps /app/node_modules ./node_modules | ||
COPY . . | ||
RUN yarn build | ||
|
||
# Run | ||
FROM node:16-alpine AS runner | ||
WORKDIR /app | ||
ENV NODE_ENV production | ||
ENV NEXT_TELEMETRY_DISABLED 1 | ||
|
||
RUN addgroup --system --gid 1001 nodejs | ||
RUN adduser --system --uid 1001 nextjs | ||
|
||
COPY --from=builder /app/next.config.js ./ | ||
COPY --from=builder /app/public ./public | ||
COPY --from=builder /app/package.json ./package.json | ||
COPY --from=builder /app/.env ./ | ||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ | ||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static | ||
|
||
USER nextjs | ||
|
||
EXPOSE 3000 | ||
|
||
ENV PORT 3000 | ||
|
||
ENTRYPOINT [ "/bin/sh", "-c" ] |
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 |
---|---|---|
@@ -0,0 +1,87 @@ | ||
version: '3' | ||
services: | ||
anvil: | ||
image: linuzeth/aelin-anvil | ||
command: ["anvil --gas-limit 18446744073709551615 --host 0.0.0.0 --allow-origin '*' --chain-id 5"] | ||
environment: | ||
- ANVIL_IP_ADDR=0.0.0.0 | ||
ports: | ||
- '8545:8545' | ||
|
||
graph-node: | ||
image: graphprotocol/graph-node | ||
ports: | ||
- '8000:8000' | ||
- '8001:8001' | ||
- '8020:8020' | ||
- '8030:8030' | ||
- '8040:8040' | ||
depends_on: | ||
- ipfs | ||
- postgres | ||
- anvil | ||
environment: | ||
postgres_host: postgres | ||
postgres_user: graph-node | ||
postgres_pass: let-me-in | ||
postgres_db: graph-node | ||
ipfs: 'ipfs:5001' | ||
ethereum: 'mainnet:http://anvil:8545' | ||
GRAPH_LOG: info | ||
|
||
ipfs: | ||
image: ipfs/go-ipfs:v0.10.0 | ||
ports: | ||
- '5001:5001' | ||
|
||
postgres: | ||
image: postgres | ||
ports: | ||
- '5432:5432' | ||
command: ['postgres', '-cshared_preload_libraries=pg_stat_statements'] | ||
environment: | ||
POSTGRES_USER: graph-node | ||
POSTGRES_PASSWORD: let-me-in | ||
POSTGRES_DB: graph-node | ||
PGDATA: '/var/lib/postgresql/data' | ||
POSTGRES_INITDB_ARGS: '-E UTF8 --locale=C' | ||
|
||
contracts-deployer: | ||
image: linuzeth/aelin-contracts-deployer | ||
command: [". ./deploy-ci.sh"] | ||
depends_on: | ||
- anvil | ||
|
||
subgraph-deployer: | ||
image: linuzeth/aelin-subgraph-deployer | ||
command: ["npm run create-local && npm run deploy-local"] | ||
depends_on: | ||
contracts-deployer: | ||
condition: service_completed_successfully | ||
|
||
aelin-ui: | ||
build: | ||
context: .. | ||
dockerfile: ./ci/Dockerfile | ||
environment: | ||
- NEXT_PUBLIC_APP_NAME=Aelin | ||
- NEXT_PUBLIC_APP_ENV=development | ||
- NEXT_PUBLIC_REACT_APP_DEFAULT_CHAIN_ID=5 | ||
- NEXT_PUBLIC_APP_URL=app.aelin.xyz | ||
- NEXT_PUBLIC_APP_NAME=aelin | ||
- [email protected] | ||
- NEXT_PUBLIC_GRAPH_ENDPOINT_GOERLI=http://0.0.0.0:8000/subgraphs/name/0xlinus/boot-node-goerli | ||
- NEXT_PUBLIC_ETH_GAS_STATION_API_URL=https://ethgasstation.info/json/ethgasAPI.json | ||
- NEXT_PUBLIC_GAS_NOW_API_URL=https://etherchain.org/api/gasnow | ||
- NEXT_PUBLIC_AELIN_POOL_FACTORY=0x8A791620dd6260079BF849Dc5567aDC3F2FdC318 | ||
- NEXT_PUBLIC_AELIN_DEAL_FACTORY=0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6 | ||
- NEXT_PUBLIC_UNI=0x610178dA211FEF7D417bC0e6FeD39F05609AD788 | ||
- NEXT_PUBLIC_USDC=0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e | ||
- NEXT_PUBLIC_ANVIL=http://0.0.0.0:8545 | ||
- CODEGEN_OUTPUT_FILE=types/generated/queries.ts | ||
ports: | ||
- '3000:3000' | ||
depends_on: | ||
subgraph-deployer: | ||
condition: service_completed_successfully | ||
|
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 |
---|---|---|
|
@@ -10,5 +10,6 @@ module.exports = { | |
"storage.googleapis.com", | ||
"ipfs.io" | ||
] | ||
} | ||
}, | ||
output: "standalone" | ||
} |
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
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
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
Oops, something went wrong.