preciazo/Dockerfile

31 lines
916 B
Text
Raw Normal View History

2024-01-14 13:18:39 +00:00
FROM cgr.dev/chainguard/wolfi-base AS base
2024-01-06 23:23:06 +00:00
WORKDIR /usr/src/app
FROM base as build
2024-01-14 13:18:39 +00:00
RUN apk add --no-cache nodejs npm
RUN npm install --global pnpm
2024-01-24 21:49:43 +00:00
COPY db-datos/package.json db-datos/package.json
COPY sitio/package.json sitio/package.json
COPY pnpm-lock.yaml pnpm-workspace.yaml .
RUN cd sitio && pnpm install
2024-01-06 23:23:06 +00:00
COPY . .
2024-01-14 13:31:23 +00:00
COPY db-datos/drizzle .
2024-01-06 23:23:06 +00:00
RUN cd sitio && \
pnpm install && \
2024-01-14 13:18:39 +00:00
pnpm build
2024-01-06 23:23:06 +00:00
2024-01-14 13:18:39 +00:00
FROM base
ENV NODE_ENV=production
2024-01-14 13:18:39 +00:00
RUN apk add --no-cache nodejs npm jq sqlite
2024-01-06 23:23:06 +00:00
# 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 .
2024-02-06 01:36:00 +00:00
COPY --from=build /usr/src/app/db-datos/drizzle drizzle
2024-01-06 23:23:06 +00:00
ENV DB_PATH=/db/db.db
EXPOSE 3000
2024-01-25 00:17:34 +00:00
CMD ["node", "."]