chore: enhance Dockerfiles and package.json for improved build process
- Added ENV npm_config_ignore_scripts=true to frontend and backend Dockerfiles to skip scripts during npm install, optimizing build times. - Introduced a postinstall script in package.json to ensure the build process for @mmapp/contracts runs after installation.
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
FROM node:22-bookworm-slim AS deps
|
FROM node:22-bookworm-slim AS deps
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
ENV npm_config_ignore_scripts=true
|
||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
COPY packages/contracts/package.json packages/contracts/
|
COPY packages/contracts/package.json packages/contracts/
|
||||||
RUN npm ci --workspace=@mmapp/contracts --include-workspace-root --ignore-scripts
|
RUN npm ci --workspace=@mmapp/contracts --include-workspace-root --ignore-scripts
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ RUN apt-get update \
|
|||||||
&& apt-get install -y --no-install-recommends python3 make g++ \
|
&& apt-get install -y --no-install-recommends python3 make g++ \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
ENV npm_config_ignore_scripts=true
|
||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
COPY packages/contracts/package.json packages/contracts/
|
COPY packages/contracts/package.json packages/contracts/
|
||||||
COPY backend/package.json backend/
|
COPY backend/package.json backend/
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "npm run build -w @mmapp/contracts && next build",
|
"build": "npm run build -w @mmapp/contracts && next build",
|
||||||
|
"postinstall": "npm run build -w @mmapp/contracts",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "eslint"
|
"lint": "eslint"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -7,8 +7,7 @@
|
|||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc -p tsconfig.json",
|
"build": "tsc -p tsconfig.json"
|
||||||
"prepare": "npm run build"
|
|
||||||
},
|
},
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
|
|||||||
Reference in New Issue
Block a user