fix: Revert to repo-root COPY paths, set dockerContextPath in Dokploy DB
All checks were successful
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s

This commit is contained in:
Ahmed Darrazi 2025-12-09 13:54:19 +01:00
parent 024c5fca00
commit 6afee7d03b

View File

@ -1,16 +1,17 @@
### Multi-stage build: compile TypeScript in a builder image, produce a smaller runtime image
### IMPORTANT: Dokploy will set build context to worker/ directory automatically
### All COPY paths must be relative to worker/ (use ../ to access parent repo root)
### IMPORTANT: Dokploy must set dockerContextPath="." (repo root) in database
### This allows the build to access package.json and other files from repo root
### Dockerfile path should be "worker/Dockerfile"
FROM node:20 AS builder
WORKDIR /usr/src/app
# Copy package manifests from parent directory and install all deps (including dev) for build
COPY ../package.json ../package-lock.json ./
# Copy package manifests and install all deps (including dev) for build
COPY package.json package-lock.json ./
RUN npm ci --silent
# Copy entire project from parent directory and compile TypeScript
COPY ../ .
# Copy entire project and compile TypeScript
COPY . .
# Try to compile the project; if there is no TS config for worker, keep files as-is
RUN npx tsc -p tsconfig.json --outDir dist || echo "tsc exit code ignored"
@ -18,7 +19,7 @@ FROM node:20-alpine AS runner
WORKDIR /usr/src/app
# Install only production dependencies
COPY ../package.json ../package-lock.json ./
COPY package.json package-lock.json ./
RUN npm ci --production --silent
# Copy compiled output from builder (if present) and essential runtime files