fix: resolve coolify docker build tsc permissions and devDependencies
This commit is contained in:
@@ -1,9 +1,13 @@
|
|||||||
|
**/node_modules
|
||||||
node_modules
|
node_modules
|
||||||
|
client/node_modules
|
||||||
|
server/node_modules
|
||||||
.git
|
.git
|
||||||
.gitignore
|
.gitignore
|
||||||
.env
|
.env
|
||||||
*.log
|
*.log
|
||||||
dist
|
dist
|
||||||
|
**/dist
|
||||||
client/dist
|
client/dist
|
||||||
server/dist
|
server/dist
|
||||||
dev.db
|
dev.db
|
||||||
|
|||||||
+10
-3
@@ -7,22 +7,29 @@
|
|||||||
FROM node:20-alpine AS client-builder
|
FROM node:20-alpine AS client-builder
|
||||||
WORKDIR /app/client
|
WORKDIR /app/client
|
||||||
|
|
||||||
|
# Ensure development environment during build stage so devDependencies (tsc, vite) are always installed
|
||||||
|
ENV NODE_ENV=development
|
||||||
|
|
||||||
COPY client/package*.json ./
|
COPY client/package*.json ./
|
||||||
RUN npm ci --no-audit --no-fund
|
RUN npm ci --no-audit --no-fund --include=dev
|
||||||
|
|
||||||
COPY client/ ./
|
COPY client/ ./
|
||||||
|
RUN chmod -R 755 node_modules/.bin || true
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Stage 2: Build Backend (TypeScript + Express + Prisma)
|
# Stage 2: Build Backend (TypeScript + Express + Prisma)
|
||||||
FROM node:20-alpine AS server-builder
|
FROM node:20-alpine AS server-builder
|
||||||
WORKDIR /app/server
|
WORKDIR /app/server
|
||||||
|
|
||||||
|
ENV NODE_ENV=development
|
||||||
|
|
||||||
COPY server/package*.json ./
|
COPY server/package*.json ./
|
||||||
COPY server/prisma ./prisma/
|
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
|
RUN npx prisma generate --schema=prisma/schema.sqlite.prisma
|
||||||
|
|
||||||
COPY server/ ./
|
COPY server/ ./
|
||||||
|
RUN chmod -R 755 node_modules/.bin || true
|
||||||
RUN npx tsc
|
RUN npx tsc
|
||||||
|
|
||||||
# Stage 3: Production Runner Image
|
# Stage 3: Production Runner Image
|
||||||
@@ -50,7 +57,7 @@ COPY --from=client-builder /app/client/dist ./public
|
|||||||
COPY server/entrypoint.sh ./entrypoint.sh
|
COPY server/entrypoint.sh ./entrypoint.sh
|
||||||
RUN chmod +x ./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
|
RUN mkdir -p /app/data
|
||||||
|
|
||||||
EXPOSE 4000
|
EXPOSE 4000
|
||||||
|
|||||||
Reference in New Issue
Block a user