2024-06-18 00:13:24 +00:00
|
|
|
FROM docker.io/node:20 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 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
|
2024-06-18 00:13:24 +00:00
|
|
|
COPY pnpm-lock.yaml pnpm-workspace.yaml ./
|
2024-01-24 21:49:43 +00:00
|
|
|
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 && \
|
2024-01-14 13:21:44 +00:00
|
|
|
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
|
2024-01-14 13:24:54 +00:00
|
|
|
ENV NODE_ENV=production
|
2024-06-18 00:13:24 +00:00
|
|
|
RUN apt-get update && apt-get install -y jq sqlite3 && apt-get clean
|
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-06-18 00:13:24 +00:00
|
|
|
CMD ["node", "."]
|