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