File tree Expand file tree Collapse file tree 3 files changed +36
-14
lines changed
Expand file tree Collapse file tree 3 files changed +36
-14
lines changed Original file line number Diff line number Diff line change 1111 workflow_dispatch :
1212
1313jobs :
14- build -and-deploy :
14+ lint -and-build :
1515 runs-on : ubuntu-latest
1616
1717 env :
6666 NEXT_PUBLIC_SSV_NETWORKS : " ${{ env.STAGE_SSV_NETWORKS }}"
6767
6868 run : pnpm build
69-
70- - name : Deploy staging
71- if : github.ref == 'refs/heads/stage'
72- uses : jakejarvis/s3-sync-action@v0.5.0
73- with :
74- args : --acl public-read --follow-symlinks --delete
75- env :
76- AWS_S3_BUCKET : ${{ secrets.STAGE_AWS_S3_BUCKET }}
77- AWS_ACCESS_KEY_ID : ${{ secrets.STAGE_AWS_SECRET_KEY_ID }}
78- AWS_SECRET_ACCESS_KEY : ${{ secrets.STAGE_AWS_SECRET_ACCESS_KEY }}
79- AWS_REGION : " us-west-2"
80- SOURCE_DIR : " build/"
8169 # </explorer.stage.ssv.network>
8270
8371 # <explorer.ssv.network>
Original file line number Diff line number Diff line change 1818# next.js
1919/.next /
2020/out /
21- next-env.d.ts
2221
2322# production
2423/build
Original file line number Diff line number Diff line change 1+ FROM node:20-alpine AS builder
2+
3+ # Set working directory
4+ WORKDIR /app
5+
6+ # Install dependencies early to leverage Docker cache
7+ COPY package.json pnpm-lock.yaml* ./
8+ RUN npm install -g pnpm && pnpm install
9+
10+ # Copy rest of the app
11+ COPY . .
12+
13+ # Build the Next.js app
14+ RUN pnpm build
15+
16+ FROM node:20-alpine AS runner
17+
18+ WORKDIR /app
19+
20+ # Only copy necessary files from builder
21+ COPY --from=builder /app/package.json ./
22+ COPY --from=builder /app/.next ./.next
23+ COPY --from=builder /app/public ./public
24+ COPY --from=builder /app/node_modules ./node_modules
25+ COPY --from=builder /app/next.config.js ./
26+ COPY --from=builder /app/tsconfig.json ./
27+
28+ # Set environment variables (override in docker-compose or runtime)
29+ ENV NODE_ENV=production
30+
31+ # Expose port (default Next.js port)
32+ EXPOSE 3000
33+
34+ # Start the Next.js server
35+ CMD ["node_modules/.bin/next" , "start" ]
You can’t perform that action at this time.
0 commit comments