Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
workflow_dispatch:

jobs:
build-and-deploy:
lint-and-build:
runs-on: ubuntu-latest

env:
Expand Down Expand Up @@ -66,18 +66,6 @@ jobs:
NEXT_PUBLIC_SSV_NETWORKS: "${{ env.STAGE_SSV_NETWORKS }}"

run: pnpm build

- name: Deploy staging
if: github.ref == 'refs/heads/stage'
uses: jakejarvis/s3-sync-action@v0.5.0
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.STAGE_AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.STAGE_AWS_SECRET_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.STAGE_AWS_SECRET_ACCESS_KEY }}
AWS_REGION: "us-west-2"
SOURCE_DIR: "build/"
# </explorer.stage.ssv.network>

# <explorer.ssv.network>
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
# next.js
/.next/
/out/
next-env.d.ts

# production
/build
Expand Down
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM node:20-alpine AS builder

# Set working directory
WORKDIR /app

# Install dependencies early to leverage Docker cache
COPY package.json pnpm-lock.yaml* ./
RUN npm install -g pnpm && pnpm install

# Copy rest of the app
COPY . .

# Build the Next.js app
RUN pnpm build

FROM node:20-alpine AS runner

WORKDIR /app

# Only copy necessary files from builder
COPY --from=builder /app/package.json ./
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/tsconfig.json ./

# Set environment variables (override in docker-compose or runtime)
ENV NODE_ENV=production

# Expose port (default Next.js port)
EXPOSE 3000

# Start the Next.js server
CMD ["node_modules/.bin/next", "start"]