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
All checks were successful
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
This commit is contained in:
parent
024c5fca00
commit
6afee7d03b
@ -1,16 +1,17 @@
|
|||||||
### Multi-stage build: compile TypeScript in a builder image, produce a smaller runtime image
|
### Multi-stage build: compile TypeScript in a builder image, produce a smaller runtime image
|
||||||
### IMPORTANT: Dokploy will set build context to worker/ directory automatically
|
### IMPORTANT: Dokploy must set dockerContextPath="." (repo root) in database
|
||||||
### All COPY paths must be relative to worker/ (use ../ to access parent repo root)
|
### 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
|
FROM node:20 AS builder
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
# Copy package manifests from parent directory and install all deps (including dev) for build
|
# Copy package manifests and install all deps (including dev) for build
|
||||||
COPY ../package.json ../package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
RUN npm ci --silent
|
RUN npm ci --silent
|
||||||
|
|
||||||
# Copy entire project from parent directory and compile TypeScript
|
# Copy entire project and compile TypeScript
|
||||||
COPY ../ .
|
COPY . .
|
||||||
# Try to compile the project; if there is no TS config for worker, keep files as-is
|
# 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"
|
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
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
# Install only production dependencies
|
# Install only production dependencies
|
||||||
COPY ../package.json ../package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
RUN npm ci --production --silent
|
RUN npm ci --production --silent
|
||||||
|
|
||||||
# Copy compiled output from builder (if present) and essential runtime files
|
# Copy compiled output from builder (if present) and essential runtime files
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user