diff --git a/Dockerfile b/Dockerfile index 1a0eee7..8e3a60a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,11 @@ -FROM node:20-slim - -# Set the working directory +FROM node:20-slim as builder WORKDIR /usr/src/app - -# Copy package.json and install dependencies -COPY package.json package-lock.json ./ +COPY package.json . +RUN npm ci RUN npm install -# Copy source files +FROM node:20-slim +WORKDIR /usr/src/app +COPY --from=builder /usr/src/app/ /usr/src/app/ COPY . . - -# Default command to run Eleventy CMD ["npx", "@11ty/eleventy", "--serve", "--port", "3000"]