diff --git a/Dockerfile b/Dockerfile index 0a5aa5b..63c51c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,25 @@ -FROM docker.io/oven/bun:1-alpine AS base +FROM cgr.dev/chainguard/wolfi-base AS base WORKDIR /usr/src/app +ENV NODE_ENV=production FROM base as build -ENV NODE_ENV=production -RUN apk add --no-cache nodejs +RUN apk add --no-cache nodejs npm +RUN npm install --global pnpm COPY . . -RUN bun install --frozen-lockfile +RUN pnpm install RUN cd sitio && \ - bun run build -RUN bun build scraper/cli.ts --target=bun --outfile=/tmp/cli.build.js + pnpm build -FROM cgr.dev/chainguard/wolfi-base -RUN apk add --no-cache nodejs npm jq bun sqlite +FROM base +RUN apk add --no-cache nodejs npm jq sqlite # Sitio COPY --from=build /usr/src/app/sitio/package.json package.real.json RUN sh -c 'echo {\"name\":\"sitio\",\"type\":\"module\",\"dependencies\":$(jq .dependencies < package.real.json)} > package.json' && npm install COPY --from=build /usr/src/app/db-datos node_modules/db-datos COPY --from=build /usr/src/app/sitio/build . +COPY --from=build /usr/src/app/db-datos/drizzle . -# Scraper -COPY --from=build /tmp/cli.build.js /bin/scraper -COPY --from=build /usr/src/app/db-datos/drizzle /bin/drizzle - -ENV NODE_ENV=production ENV DB_PATH=/db/db.db EXPOSE 3000