Add Dockerfile

This commit is contained in:
Gal 2024-11-21 18:57:57 +01:00
parent 8b3075a09c
commit bdf2940e7b
Signed by: gal
GPG Key ID: F035BC65003BC00B
1 changed files with 6 additions and 9 deletions

View File

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