Skip to content

Commit

Permalink
Merge pull request #327 from P4-Games/develop
Browse files Browse the repository at this point in the history
Deploy-20240118
  • Loading branch information
dappsar authored Jan 18, 2024
2 parents cab7183 + dce534b commit 68429a3
Show file tree
Hide file tree
Showing 70 changed files with 4,158 additions and 1,097 deletions.
29 changes: 4 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,50 +1,29 @@
# Install dependencies only when needed
FROM node:16-alpine AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
FROM node:18-alpine AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app

# COPY package.json yarn.lock ./
# RUN yarn install --frozen-lockfile

# If using npm with a `package-lock.json` comment out above and use below instead
COPY package.json package-lock.json ./
RUN npm ci

# Rebuild the source code only when needed
FROM node:16-alpine AS builder
FROM node:18-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .

# RUN yarn build

# If using npm comment out above and use below instead
RUN npm run build

# Production image, copy all the files and run next
FROM node:16-alpine AS runner
FROM node:18-alpine AS runner
WORKDIR /app

ENV NODE_ENV production

ENV NODE_ENV=production
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

# You only need to copy next.config.js if you are NOT using the default configuration
COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
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

CMD ["node", "server.js"]
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
![](https://img.shields.io/badge/Solidity-informational?style=flat&logo=solidity&logoColor=white&color=6aa6f8)
![](https://img.shields.io/badge/Hardhat-informational?style=flat&logo=hardhat&logoColor=white&color=6aa6f8)

# Number One Fun (NoF)
# Number One Fan (NoF)

![nof-landing](./.doc/images/nof.png)

Expand Down Expand Up @@ -49,23 +49,24 @@ NODE_ENV='development'
APP_ENV='development'
GAMMA_SERVICE_URL='https://gamma-microservice-7bteynlhua-uc.a.run.app'
GRAPH_URL='https://api.thegraph.com/subgraphs/name/tomasfrancizco/nof_polygon'
WALLET_CONNECT_PROJECT_ID={you project ID from walletconnect.com}
CHAIN_NODE_PROVIDER_URL='https://polygon-mumbai.g.alchemy.com/v2/YOUR_API_KEY'

# Client-side
NEXT_PUBLIC_STORAGE_URL_ALPHA='https://storage.googleapis.com/nof-alpha'
NEXT_PUBLIC_STORAGE_URL_GAMMA='https://storage.googleapis.com/nof-gamma'
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID={you project ID from walletconnect.com}
NEXT_PUBLIC_CHAIN_NAME='mumbai'
NEXT_PUBLIC_CHAIN_ID='0x13881'
NEXT_PUBLIC_CHAIN_CURRENCY='MATIC'
NEXT_PUBLIC_CHAIN_RPC_URL='https://rpc-mumbai.maticvigil.com'
NEXT_PUBLIC_CHAIN_EXPLORER_URL='https://mumbai.polygonscan.com'
NEXT_PUBLIC_DAI_ADDRESS='0x59876b33dd6e725Da632B4DB50d90d33ab022dB6'
NEXT_PUBLIC_ALPHA_ADDRESS='0x1772F33b587B4ed32f59Dc6B09B9e994616C1eCB'
NEXT_PUBLIC_GAMMA_PACKS_ADDRESS='0xc0a2630f551106190d95C2348e02E400478e711c'
NEXT_PUBLIC_GAMMA_CARDS_ADDRESS='0xa888449f2CB7AB034D08051Bf1a9D7402DE959ab'
NEXT_PUBLIC_DAI_ADDRESS=''
NEXT_PUBLIC_ALPHA_ADDRESS=''
NEXT_PUBLIC_GAMMA_PACKS_ADDRESS=''
NEXT_PUBLIC_GAMMA_CARDS_ADDRESS=''
NEXT_PUBLIC_GAMMA_OFFERS_ADDRESS=''
NEXT_PUBLIC_GAMMA_TICKETS_ADDRESS=''
NEXT_PUBLIC_ADMIN_ACCOUNTS='0x35dad65F60c1A32c9895BE97f6bcE57D32792E83,0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
NEXT_PUBLIC_CHAIN_NODE_PROVIDER_URL='https://polygon-mumbai.g.alchemy.com/v2/YOUR_API_KEY'

```

Expand Down
13 changes: 11 additions & 2 deletions example_env
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,26 @@ NODE_ENV='development' // development, production
APP_ENV='development'
GAMMA_SERVICE_URL='https://gamma-microservice-7bteynlhua-uc.a.run.app'
GRAPH_URL='https://api.thegraph.com/subgraphs/name/tomasfrancizco/nof_polygon'
MAIL_CLIENT= // sendgrid | ethereal
MAIL_FROM='no-reply@nof.town'
MAIL_TO= // email address
MAIL_ETHEREAL_HOST=smtp.ethereal.email
MAIL_ETHEREAL_PORT=587
MAIL_ETHEREAL_USER= // email address from ethereal.email
MAIL_ETHEREAL_PSWD= // pswd from ethereal.email
MAIL_SG_KEY= // sendgrid api key
MAIL_SG_FROM= // email address
WALLET_CONNECT_PROJECT_ID='your_project_id_api_key'
CHAIN_NODE_PROVIDER_URL='https://polygon-mumbai.g.alchemy.com/YOUR_API_KEY'

// client-side
NEXT_PUBLIC_STORAGE_URL_ALPHA='https://storage.googleapis.com/nof-alpha'
NEXT_PUBLIC_STORAGE_URL_GAMMA='https://storage.googleapis.com/nof-gamma'
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID='your_project_id_api_key'
NEXT_PUBLIC_CHAIN_NAME='localhost'
NEXT_PUBLIC_CHAIN_ID='0x539' // '0x539' = 1337 (hardhat node) | '0x89' = Polygon Mainnet | '0x13881' = Mumbai
NEXT_PUBLIC_CHAIN_CURRENCY='ETH'
NEXT_PUBLIC_CHAIN_RPC_URL='http://localhost:8545'
NEXT_PUBLIC_CHAIN_EXPLORER_URL='https://mumbai.polygonscan.com'
NEXT_PUBLIC_CHAIN_NODE_PROVIDER_URL='https://polygon-mumbai.g.alchemy.com/YOUR_API_KEY'
NEXT_PUBLIC_ADMIN_ACCOUNTS='0x...,0X....,0xfa3....' // accounts separated by a comma
NEXT_PUBLIC_DAI_ADDRESS='0x59876b33dd6e725Da632B4DB50d90d33ab022dB6'
NEXT_PUBLIC_ALPHA_ADDRESS='0x1772F33b587B4ed32f59Dc6B09B9e994616C1eCB'
Expand Down
4 changes: 2 additions & 2 deletions next-pwa.config → next-pwa.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = withPWA({
runtimeCaching,
sw: 'service-worker.js',
publicExcludes: ['!robots.txt'], // https://github.com/shadowwalker/next-pwa/issues/94
disable: process.env.NODE_ENV === "development", // to avoid reload with changes in webpack in development
disable: process.env.NODE_ENV === 'development', // to avoid reload with changes in webpack in development
fallbacks: {
image: '/images/common/fallback.png'
// document: '/other-offline', // if you want to fallback to a custom page other than /_offline
Expand All @@ -18,4 +18,4 @@ module.exports = withPWA({
// video: ...,
}
}
})
})
Loading

0 comments on commit 68429a3

Please sign in to comment.