Skip to content

Commit 07eddf1

Browse files
authored
Merge pull request #11 from Sentinel-Bluebuilder/claude/quirky-hofstadter-d0913b
ci(docker): collapse build to a single npm ci to fix slow builds
2 parents cd68527 + a1443ce commit 07eddf1

3 files changed

Lines changed: 15 additions & 10 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ jobs:
4242
ghcr.io/${{ env.REPO }}:latest
4343
ghcr.io/${{ env.REPO }}:${{ github.sha }}
4444
cache-from: type=gha
45-
cache-to: type=gha,mode=max
45+
cache-to: type=gha,mode=min

server/.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
dist
3+
.env
4+
.env.*
5+
*.log
6+
test
7+
README.md
8+
.dockerignore
9+
Dockerfile
10+
docker-compose.yml

server/Dockerfile

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,11 @@
44
FROM node:22-alpine AS build
55
WORKDIR /app
66
COPY package.json package-lock.json* ./
7-
RUN npm ci
7+
RUN npm ci --ignore-scripts --no-audit --no-fund --loglevel=error
88
COPY tsconfig.json ./
99
COPY src ./src
10-
RUN npm run build
11-
12-
# ─── Production deps only ───
13-
FROM node:22-alpine AS deps
14-
WORKDIR /app
15-
COPY package.json package-lock.json* ./
16-
RUN npm ci --omit=dev
10+
RUN npm run build \
11+
&& npm prune --omit=dev --ignore-scripts
1712

1813
# ─── Runtime ───
1914
FROM node:22-alpine AS runtime
@@ -24,7 +19,7 @@ ENV FACILITATOR_PORT=4021
2419

2520
RUN addgroup -S app && adduser -S app -G app
2621

27-
COPY --from=deps /app/node_modules ./node_modules
22+
COPY --from=build /app/node_modules ./node_modules
2823
COPY --from=build /app/dist ./dist
2924
COPY package.json ./
3025

0 commit comments

Comments
 (0)