chore: enhance Dockerfile for backend to rebuild better-sqlite3
- Updated the backend Dockerfile to include a rebuild step for better-sqlite3 after npm ci, improving compatibility and performance. - Removed redundant package installation commands to streamline the Docker build process.
This commit is contained in:
+2
-5
@@ -5,11 +5,11 @@ 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/
|
||||||
RUN npm ci --workspace=@mmapp/contracts --workspace=mikrotik-manager-backend --include-workspace-root --ignore-scripts
|
RUN npm ci --workspace=@mmapp/contracts --workspace=mikrotik-manager-backend --include-workspace-root --ignore-scripts \
|
||||||
|
&& npm rebuild better-sqlite3
|
||||||
|
|
||||||
FROM deps AS build
|
FROM deps AS build
|
||||||
COPY packages/contracts packages/contracts
|
COPY packages/contracts packages/contracts
|
||||||
@@ -19,9 +19,6 @@ RUN npm run build -w @mmapp/contracts \
|
|||||||
&& npm prune --omit=dev
|
&& npm prune --omit=dev
|
||||||
|
|
||||||
FROM node:22-bookworm-slim AS runner
|
FROM node:22-bookworm-slim AS runner
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get install -y --no-install-recommends python3 make g++ \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV PORT=8000
|
ENV PORT=8000
|
||||||
|
|||||||
Reference in New Issue
Block a user