# Datewise web app (admin, app proxy, webhooks) and background worker (hold sweeps, reminders, # order reconciliation) — one image, two processes. The Shopify extensions and functions are # deployed separately with `shopify app deploy`. FROM node:22-alpine AS build RUN apk add --no-cache openssl WORKDIR /app COPY package.json package-lock.json ./ RUN npm ci COPY . . # Build first, prune dev dependencies after (vite, esbuild and the type packages are needed to build). RUN npx prisma generate \ && npm run build \ && npx esbuild app/jobs/worker.ts --bundle --platform=node --format=esm --packages=external --outfile=build/worker.mjs \ && npm prune --omit=dev FROM node:22-alpine RUN apk add --no-cache openssl WORKDIR /app ENV NODE_ENV=production COPY --from=build /app/package.json /app/package-lock.json ./ COPY --from=build /app/node_modules ./node_modules COPY --from=build /app/build ./build COPY --from=build /app/public ./public COPY --from=build /app/prisma ./prisma EXPOSE 3000 HEALTHCHECK --interval=30s --timeout=5s --start-period=40s CMD wget -qO- http://127.0.0.1:3000/healthz || exit 1 # Web (default): apply database migrations, then start. The worker service overrides this with `node build/worker.mjs`. CMD ["sh", "-c", "npx prisma migrate deploy && npx react-router-serve ./build/server/index.js"]