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++ \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
WORKDIR /app
|
||||
ENV npm_config_ignore_scripts=true
|
||||
COPY package.json package-lock.json ./
|
||||
COPY packages/contracts/package.json packages/contracts/
|
||||
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
|
||||
COPY packages/contracts packages/contracts
|
||||
@@ -19,9 +19,6 @@ RUN npm run build -w @mmapp/contracts \
|
||||
&& npm prune --omit=dev
|
||||
|
||||
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
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=8000
|
||||
|
||||
Reference in New Issue
Block a user