fix: resolve coolify docker build tsc permissions and devDependencies
This commit is contained in:
+10
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user