All checks were successful
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
20 lines
598 B
Docker
20 lines
598 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 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"]
|