preciazo/Dockerfile

26 lines
723 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-06 23:23:06 +00:00
COPY . .
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-01-14 13:18:39 +00:00
COPY --from=build /usr/src/app/db-datos/drizzle .
2024-01-06 23:23:06 +00:00
ENV DB_PATH=/db/db.db
EXPOSE 3000
2024-01-07 00:17:18 +00:00
CMD ["node", "."]