Skip to content

Commit

Permalink
ci: update dockerfile ad envs
Browse files Browse the repository at this point in the history
  • Loading branch information
osiastedian committed Oct 3, 2024
1 parent a45020a commit 26cff43
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@ RUN \
# Rebuild the source code only when needed
FROM node:18-alpine AS builder
WORKDIR /app

# Accept build-time arguments for CHAIN_ID and RPC_URL
ARG NEXT_PUBLIC_NEVM_RPC_URL
ARG NEXT_PUBLIC_IS_TESTNET
ARG NEXT_PUBLIC_NEVM_EXPLORER_URL
ARG NEXT_PUBLIC_CHAIN_ID
ARG NEXT_PUBLIC_BLOCKBOOK_API_URL


# Set environment variables for build phase
ENV NEXT_PUBLIC_NEVM_RPC_URL=$NEXT_PUBLIC_NEVM_RPC_URL
ENV NEXT_PUBLIC_IS_TESTNET=$NEXT_PUBLIC_IS_TESTNET
ENV NEXT_PUBLIC_NEVM_EXPLORER_URL=$NEXT_PUBLIC_NEVM_EXPLORER_URL
ENV NEXT_PUBLIC_CHAIN_ID=$NEXT_PUBLIC_CHAIN_ID
ENV NEXT_PUBLIC_BLOCKBOOK_API_URL=$NEXT_PUBLIC_BLOCKBOOK_API_URL

COPY --from=deps /app/node_modules ./node_modules
COPY . .

Expand Down Expand Up @@ -54,4 +70,10 @@ EXPOSE 3000

ENV PORT 3000

ENV NEXT_PUBLIC_NEVM_RPC_URL=$NEXT_PUBLIC_NEVM_RPC_URL
ENV NEXT_PUBLIC_IS_TESTNET=$NEXT_PUBLIC_IS_TESTNET
ENV NEXT_PUBLIC_NEVM_EXPLORER_URL=$NEXT_PUBLIC_NEVM_EXPLORER_URL
ENV NEXT_PUBLIC_CHAIN_ID=$NEXT_PUBLIC_CHAIN_ID
ENV NEXT_PUBLIC_BLOCKBOOK_API_URL=$NEXT_PUBLIC_BLOCKBOOK_API_URL

CMD ["node", "server.js"]

0 comments on commit 26cff43

Please sign in to comment.