mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-15 23:16:36 +00:00
32 lines
611 B
Docker
32 lines
611 B
Docker
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 ./ ./
|
|
|
|
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 |