# Use a build argument for the platform to satisfy the warning ARG TARGETPLATFORM=linux/amd64 FROM --platform=${TARGETPLATFORM} node:20-bookworm-slim WORKDIR /app ENV NODE_ENV=production # 1. Copy only the dependency files first (better caching) COPY package*.json ./ # 2. Install only production dependencies # This keeps the image small RUN npm install --omit=dev && npm install -g tsx # 3. Copy only the folders the worker actually needs # This avoids copying the massive .next or .git folders COPY scripts ./scripts COPY lib ./lib COPY config ./config # 4. Create data directory RUN mkdir -p /app/data # 5. Run using tsx (already installed) CMD ["tsx", "scripts/update-space.ts"]