fix: resolve coolify docker build tsc permissions and devDependencies

This commit is contained in:
Power BI Dev
2026-08-17 18:29:40 +07:00
parent 88c7c653c2
commit 2a9cf59e55
2 changed files with 14 additions and 3 deletions
+4
View File
@@ -1,9 +1,13 @@
**/node_modules
node_modules
client/node_modules
server/node_modules
.git
.gitignore
.env
*.log
dist
**/dist
client/dist
server/dist
dev.db
+10 -3
View File
@@ -7,22 +7,29 @@
FROM node:20-alpine AS client-builder
WORKDIR /app/client
# Ensure development environment during build stage so devDependencies (tsc, vite) are always installed
ENV NODE_ENV=development
COPY client/package*.json ./
RUN npm ci --no-audit --no-fund
RUN npm ci --no-audit --no-fund --include=dev
COPY client/ ./
RUN chmod -R 755 node_modules/.bin || true
RUN npm run build
# Stage 2: Build Backend (TypeScript + Express + Prisma)
FROM node:20-alpine AS server-builder
WORKDIR /app/server
ENV NODE_ENV=development
COPY server/package*.json ./
COPY server/prisma ./prisma/
RUN npm ci --no-audit --no-fund
RUN npm ci --no-audit --no-fund --include=dev
RUN npx prisma generate --schema=prisma/schema.sqlite.prisma
COPY server/ ./
RUN chmod -R 755 node_modules/.bin || true
RUN npx tsc
# Stage 3: Production Runner Image
@@ -50,7 +57,7 @@ COPY --from=client-builder /app/client/dist ./public
COPY server/entrypoint.sh ./entrypoint.sh
RUN chmod +x ./entrypoint.sh
# Create persistent storage folder for SQLite (if used)
# Create persistent storage folder for SQLite
RUN mkdir -p /app/data
EXPOSE 4000