personal-website/Dockerfile
Cyril Šebek 6197331f20
Some checks failed
Build Docker Image and Deploy / Build Image and push to Registry (push) Failing after 1m22s
Build Docker Image and Deploy / Deploy on webserver (push) Has been skipped
Pnpm-ify dockerfile
2024-07-07 21:26:11 +02:00

27 lines
575 B
Docker

FROM node:lts-slim AS build
WORKDIR /app
RUN corepack enable pnpm
COPY package.json package.json
RUN pnpm install
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
COPY --from=build /app/dist /app/dist
COPY --from=build /app/package.json /app/package.json
COPY --from=build /app/package-lock.json /app/package-lock.json
RUN npm ci
EXPOSE 4321
CMD ["npm", "run", "preview"]