From bdf2940e7b1cbaec0635915634e4217eb75013ad Mon Sep 17 00:00:00 2001 From: Gal Date: Thu, 21 Nov 2024 18:57:57 +0100 Subject: [PATCH] Add Dockerfile --- Dockerfile | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) 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"]