Complete application scaffolding with: - Backend: Node.js + Fastify + sql.js (SQLite) - Frontend: SvelteKit + Tailwind CSS - Scraper engine with parallel fan-out, rate limiting, cheerio-based parsing - Store management with CSS selector config and per-store test pages - Docker setup for single-command deployment Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
37 lines
759 B
Docker
37 lines
759 B
Docker
# Stage 1: Build client
|
|
FROM node:20-alpine AS client-build
|
|
WORKDIR /app/src/client
|
|
COPY src/client/package*.json ./
|
|
RUN npm ci
|
|
COPY src/client/ ./
|
|
RUN npm run build
|
|
|
|
# Stage 2: Build server
|
|
FROM node:20-alpine AS server-build
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm ci
|
|
COPY tsconfig.json ./
|
|
COPY src/server/ ./src/server/
|
|
RUN npx tsc
|
|
|
|
# Stage 3: Production runtime
|
|
FROM node:20-alpine
|
|
WORKDIR /app
|
|
|
|
COPY package*.json ./
|
|
RUN npm ci --omit=dev
|
|
|
|
COPY --from=server-build /app/dist ./dist
|
|
COPY --from=client-build /app/src/client/build ./dist/client
|
|
COPY src/server/db/migrations ./dist/server/db/migrations
|
|
|
|
ENV NODE_ENV=production
|
|
ENV PORT=3000
|
|
ENV DATABASE_PATH=/app/data/pricehunter.db
|
|
|
|
EXPOSE 3000
|
|
VOLUME /app/data
|
|
|
|
CMD ["node", "dist/server/index.js"]
|