personal-website/Dockerfile

25 lines
548 B
Docker
Raw Normal View History

FROM node:lts-slim AS build
WORKDIR /app
COPY package.json package.json
RUN npm 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"]