### Single-stage build: Run worker with tsx TypeScript runtime ### IMPORTANT: Dokploy must set dockerContextPath="." (repo root) in database ### Dockerfile path should be "worker/Dockerfile" FROM node:20-alpine AS runtime WORKDIR /usr/src/app # Install production dependencies AND tsx for TypeScript runtime COPY package.json package-lock.json ./ RUN npm ci --production --silent && npm install tsx dotenv --silent # Copy tsconfig for path mapping resolution (@/ alias) COPY tsconfig.json ./ # Copy worker code and shared lib COPY worker ./worker COPY lib ./lib ENV NODE_ENV=production # Run worker using tsx (TypeScript runtime) CMD ["npx", "tsx", "./worker/index.ts"]