Skip to content

Latest commit

 

History

History
35 lines (28 loc) · 791 Bytes

docker-static-solution.md

File metadata and controls

35 lines (28 loc) · 791 Bytes
  1. Create a .dockerignore file at the root of the project directory. Add the following content to the file:
node_modules
dist
README.md
  1. Create a Dockerfile at the root of the project directory with the following content:
FROM node:22-alpine
RUN addgroup --system lightness && adduser --system lightness --ingroup lightness
WORKDIR /lightness
COPY . .
RUN chown -R lightness:lightness .
USER lightness
RUN npm ci
CMD npm start
  1. Build the image and run a container. The following commands assume you are at the root of the project directory.
$> docker build -t lightness .
$> docker run -p 8080:5173 lightness