mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-16 07:26:35 +00:00
Move the documentation repository to a public repo
Added a LICENSE and documentation on how to contribute Updated CI/CD to use the root level code
This commit is contained in:
30
docker/Dockerfile
Normal file
30
docker/Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
FROM node:16-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
|
||||
RUN npm install --production
|
||||
|
||||
# Copy all files
|
||||
COPY ./ ./
|
||||
|
||||
# Build app
|
||||
RUN npm run build
|
||||
|
||||
# Expose the listening port
|
||||
EXPOSE 3000
|
||||
|
||||
# Run container as non-root (unprivileged) user
|
||||
# The node user is provided in the Node.js Alpine base image
|
||||
USER node
|
||||
|
||||
# Run npm start script with PM2 when container starts
|
||||
CMD [ "pm2-runtime", "npm", "--", "start" ]
|
||||
Reference in New Issue
Block a user