π½Database Backup and Recovery
# backend/Dockerfile
FROM node:17-alpine As development
# setting the image working directory which the backend folder of the root directory
WORKDIR /usr/src/app/backend
# copy package.json and package-lock.json to the image working directory
COPY package*.json ./
# install tools for mongodump and mongorestore commands
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.6/main' >> /etc/apk/repositories
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.6/community' >> /etc/apk/repositories
RUN apk update
RUN apk add mongodb
RUN apk add mongodb-tools
# install development dependencies
RUN npm install --only=development --force
# copy the application code to the working directory of image
COPY . .
# EXPOSE 3000
# build the application
RUN npm run buildLast updated