fix(api): Dockerfile explícito para dist+node_modules; quitar image: para forzar build en Coolify
This commit is contained in:
+5
-2
@@ -8,14 +8,17 @@ COPY . .
|
|||||||
RUN pnpm install --frozen-lockfile 2>/dev/null || pnpm install --no-frozen-lockfile --force
|
RUN pnpm install --frozen-lockfile 2>/dev/null || pnpm install --no-frozen-lockfile --force
|
||||||
RUN pnpm --filter @moraworld/database exec prisma generate && pnpm --filter @moraworld/database build
|
RUN pnpm --filter @moraworld/database exec prisma generate && pnpm --filter @moraworld/database build
|
||||||
RUN pnpm --filter @moraworld/api build
|
RUN pnpm --filter @moraworld/api build
|
||||||
# pnpm deploy crea un dir autocontenido sin symlinks al store virtual
|
# pnpm deploy resuelve node_modules sin symlinks del store virtual
|
||||||
RUN pnpm --filter @moraworld/api deploy --prod /app/deploy
|
RUN pnpm --filter @moraworld/api deploy --prod /app/deploy
|
||||||
|
|
||||||
FROM node:22-alpine AS runner
|
FROM node:22-alpine AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
RUN addgroup -S app && adduser -S app app
|
RUN addgroup -S app && adduser -S app app
|
||||||
COPY --from=builder /app/deploy ./
|
# node_modules de pnpm deploy (sin symlinks rotos) + dist del build explícito
|
||||||
|
COPY --from=builder /app/deploy/node_modules ./node_modules
|
||||||
|
COPY --from=builder /app/apps/api/dist ./dist
|
||||||
|
COPY --from=builder /app/apps/api/package.json ./
|
||||||
COPY --from=builder /app/packages/database ./packages/database
|
COPY --from=builder /app/packages/database ./packages/database
|
||||||
USER app
|
USER app
|
||||||
EXPOSE 3001
|
EXPOSE 3001
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
api:
|
api:
|
||||||
image: ghcr.io/lizandrogd/moraworld-imports/api:latest
|
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: apps/api/Dockerfile
|
dockerfile: apps/api/Dockerfile
|
||||||
@@ -40,7 +39,6 @@ services:
|
|||||||
memory: 512M
|
memory: 512M
|
||||||
|
|
||||||
web:
|
web:
|
||||||
image: ghcr.io/lizandrogd/moraworld-imports/web:latest
|
|
||||||
depends_on:
|
depends_on:
|
||||||
api:
|
api:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|||||||
Reference in New Issue
Block a user