tenantpilot/worker/Dockerfile
Ahmed Darrazi 6ce68b9a2f
All checks were successful
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
fix: Copy tsconfig.json for tsx path mapping resolution
2025-12-09 14:05:28 +01:00

23 lines
676 B
Docker

### 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"]