fix: multi-stage Dockerfile and guard husky for Docker builds
Multi-stage build produces a smaller production image with only .output. Husky prepare script now tolerates missing .git (Docker, CI).
This commit is contained in:
parent
1e30ba23cd
commit
61c16d8bac
2 changed files with 9 additions and 5 deletions
12
Dockerfile
12
Dockerfile
|
|
@ -1,12 +1,16 @@
|
||||||
# Dockerfile
|
# Build stage
|
||||||
FROM node:20-alpine
|
FROM node:20-alpine AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm ci
|
RUN npm ci --ignore-scripts && npx nuxt prepare
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
# Production stage — only the self-contained .output is needed
|
||||||
|
FROM node:20-alpine
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=builder /app/.output .output
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
CMD ["node", ".output/server/index.mjs"]
|
CMD ["node", ".output/server/index.mjs"]
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
"test:visual:update": "npx playwright test e2e/visual/ --update-snapshots",
|
"test:visual:update": "npx playwright test e2e/visual/ --update-snapshots",
|
||||||
"test:a11y": "npx playwright test e2e/a11y.spec.js",
|
"test:a11y": "npx playwright test e2e/a11y.spec.js",
|
||||||
"test:all": "npm run test:run && npx playwright test",
|
"test:all": "npm run test:run && npx playwright test",
|
||||||
"prepare": "husky"
|
"prepare": "husky || true"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cloudinary/vue": "^1.13.3",
|
"@cloudinary/vue": "^1.13.3",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue