chore(worker): add Dockerfile and Dokploy README (build path: worker/)
All checks were successful
Trigger Cloudarix Deploy / call-webhook (push) Successful in 2s

This commit is contained in:
Ahmed Darrazi 2025-12-09 12:43:46 +01:00
parent 54e6ed7ecc
commit 2843281f2f
2 changed files with 45 additions and 0 deletions

24
worker/Dockerfile Normal file
View File

@ -0,0 +1,24 @@
FROM node:20
# Create app directory
WORKDIR /usr/src/app
# Install dependencies first (copy package files)
COPY package.json package-lock.json ./
# Install full dependencies so `tsx` can run worker/index.ts
RUN npm ci --silent
# Copy only required directories to keep image smaller
COPY worker ./worker
COPY lib ./lib
COPY node_modules ./node_modules
COPY .env* ./
COPY tsconfig.json ./
ENV NODE_ENV=production
# Set working directory to repo root; worker is invoked by npm script
WORKDIR /usr/src/app
CMD ["npm", "run", "worker:start"]

21
worker/README.md Normal file
View File

@ -0,0 +1,21 @@
Worker container and Dokploy settings
====================================
Build context
-------------
- Build path: `worker/` (Dokploy should use this path so the worker Dockerfile is found)
- Dockerfile: `worker/Dockerfile`
Recommended Dokploy settings
----------------------------
- Provider: `Gitea`
- Repository: `ahmido/tenantpilot` (or your repo)
- Branch: `development`
- Build path: `worker/`
- Watch paths: `worker/**`, `lib/**`, `package.json`, `package-lock.json`
Notes
-----
- The `Dockerfile` runs `npm ci` and then `npm run worker:start`, which uses `tsx` to execute `worker/index.ts` directly.
- If you prefer a smaller production image, consider adding a build step to compile TypeScript to JS and run the compiled output with `node`.
- If Dokploy requires a separate webhook per app, use the worker webhook URL provided in this repo's docs/workflow.