Skip to content

Commit 7f7de6c

Browse files
authored
Merge pull request #144 from ssvlabs/feat/dockerfile-and-updated-github-yaml
feat: added dockerfile and updated github actions yaml to lint and bu…
2 parents 405886f + 1d1e119 commit 7f7de6c

File tree

3 files changed

+36
-14
lines changed

3 files changed

+36
-14
lines changed
Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
workflow_dispatch:
1212

1313
jobs:
14-
build-and-deploy:
14+
lint-and-build:
1515
runs-on: ubuntu-latest
1616

1717
env:
@@ -66,18 +66,6 @@ jobs:
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>

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
# next.js
1919
/.next/
2020
/out/
21-
next-env.d.ts
2221

2322
# production
2423
/build

Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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"]

0 commit comments

Comments
 (0)