diff --git a/worker/Dockerfile b/worker/Dockerfile index 816c91f..4fd5572 100644 --- a/worker/Dockerfile +++ b/worker/Dockerfile @@ -1,16 +1,16 @@ ### Multi-stage build: compile TypeScript in a builder image, produce a smaller runtime image -### IMPORTANT: Set Dokploy build path to "/" (repo root), NOT "worker/" -### Dockerfile path should be "worker/Dockerfile" +### IMPORTANT: Dokploy will set build context to worker/ directory automatically +### All COPY paths must be relative to worker/ (use ../ to access parent repo root) FROM node:20 AS builder WORKDIR /usr/src/app -# Copy package manifests and install all deps (including dev) for build -COPY package.json package-lock.json ./ +# Copy package manifests from parent directory and install all deps (including dev) for build +COPY ../package.json ../package-lock.json ./ RUN npm ci --silent -# Copy project files and compile TypeScript output to `dist/` -COPY . . +# Copy entire project from parent directory 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 +18,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