docker sitio: actualizar

This commit is contained in:
Cat /dev/Nulo 2024-01-14 10:18:39 -03:00
parent d805ebbe72
commit c52ed1d569

View file

@ -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 WORKDIR /usr/src/app
ENV NODE_ENV=production
FROM base as build FROM base as build
ENV NODE_ENV=production RUN apk add --no-cache nodejs npm
RUN apk add --no-cache nodejs RUN npm install --global pnpm
COPY . . COPY . .
RUN bun install --frozen-lockfile RUN pnpm install
RUN cd sitio && \ RUN cd sitio && \
bun run build pnpm build
RUN bun build scraper/cli.ts --target=bun --outfile=/tmp/cli.build.js
FROM cgr.dev/chainguard/wolfi-base FROM base
RUN apk add --no-cache nodejs npm jq bun sqlite RUN apk add --no-cache nodejs npm jq sqlite
# Sitio # Sitio
COPY --from=build /usr/src/app/sitio/package.json package.real.json 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 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/db-datos node_modules/db-datos
COPY --from=build /usr/src/app/sitio/build . 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 ENV DB_PATH=/db/db.db
EXPOSE 3000 EXPOSE 3000