Files
netbird-docs/docker/Dockerfile
Jack Carter 51afd0cf71 build: use npm ci for clean, reproducible installs (#839)
Switch pr-build and the Docker image from `npm install` to `npm ci` (`npm ci --omit=dev` in the image), and enable setup-node's npm cache. Deterministic installs from the committed lockfile; CI now fails fast on an out-of-sync lockfile.

Depends on the lockfile being tracked (PR #838) — npm ci requires a committed package-lock.json.
2026-07-09 13:19:31 +02:00

32 lines
661 B
Docker

FROM node:20-alpine
# Set working directory
WORKDIR /usr/app
# Install PM2 globally
RUN npm install --global pm2
# Copy package.json and package-lock.json before other files
# Utilise Docker cache to save re-installing dependencies if unchanged
COPY ./package*.json ./
# Install dependencies (npm ci = clean, reproducible install from the lockfile)
RUN npm ci --omit=dev
# Copy all files
COPY ./ ./
COPY /docker/entrypoint.sh ./entrypoint.sh
# Build app
RUN npm run build
RUN chmod u+x /usr/app/entrypoint.sh
# Expose the listening port
EXPOSE 3000
# apply env variables to the Nextjs .env file
ENTRYPOINT ["/usr/app/entrypoint.sh"]
CMD npm run start