2024-07-07 20:33:35 +02:00
|
|
|
FROM node:lts-slim AS build
|
|
|
|
WORKDIR /app
|
|
|
|
|
2024-07-07 21:26:11 +02:00
|
|
|
RUN corepack enable pnpm
|
|
|
|
|
2024-07-07 20:33:35 +02:00
|
|
|
COPY package.json package.json
|
2024-07-07 21:26:11 +02:00
|
|
|
RUN pnpm install
|
2024-07-07 20:33:35 +02:00
|
|
|
|
|
|
|
COPY public/ public
|
|
|
|
COPY src/ src
|
|
|
|
COPY astro.config.mjs astro.config.mjs
|
|
|
|
COPY tailwind.config.mjs tailwind.config.mjs
|
|
|
|
COPY tsconfig.json tsconfig.json
|
|
|
|
COPY components.json components.json
|
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
FROM node:lts-slim as prod
|
|
|
|
WORKDIR /app
|
|
|
|
|
2024-07-07 21:36:37 +02:00
|
|
|
RUN corepack enable pnpm
|
|
|
|
|
2024-07-07 20:33:35 +02:00
|
|
|
COPY --from=build /app/dist /app/dist
|
|
|
|
COPY --from=build /app/package.json /app/package.json
|
2024-07-07 21:33:33 +02:00
|
|
|
COPY --from=build /app/pnpm-lock.yaml /app/pnpm-lock.yaml
|
2024-07-07 21:36:37 +02:00
|
|
|
RUN pnpm install --frozen-lockfile
|
2024-07-07 20:33:35 +02:00
|
|
|
|
|
|
|
EXPOSE 4321
|
|
|
|
|
|
|
|
CMD ["npm", "run", "preview"]
|