personal-website/Dockerfile
Cyril Šebek 5023fc631f
Some checks failed
Build Docker Image and Deploy / Build Image and push to Registry (push) Successful in 29s
Build Docker Image and Deploy / Deploy on webserver (push) Failing after 9s
Someone told me to do this
2024-07-07 21:46:02 +02:00

29 lines
611 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
WORKDIR /app
RUN corepack enable pnpm
COPY --from=build /app/dist /app/dist
COPY --from=build /app/package.json /app/package.json
COPY --from=build /app/pnpm-lock.yaml /app/pnpm-lock.yaml
RUN pnpm install --frozen-lockfile
EXPOSE 4321
CMD ["npm", "run", "preview"]