# Use the official Node.js 16 image as base imageFROM node:16.14.0-buster# Upgrade npm to the latest versionRUN npm install-g npm@9.6.2# Set the author of the DockerfileLABEL maintainer="YIN"# Add the application source code to the containerADD lottery.tar.gz /# Set the working directory to the root directory of the applicationWORKDIR /lottery# Set the ownership of the application directory to rootRUN chown-R root /lottery \# Remove the line that opens the default browser when starting the server && sed -i '/openBrowser/ d' ./server/server.js \ # Install dependencies for the server and product directories && cd server && npm install \ && cd ../product && npm install \ # Build the application && npm run build# Expose port 8080 to the outside worldEXPOSE 8080# Set the working directory to the product directoryWORKDIR /lottery/product# Start the serverCMD ["npm", "run", "serve"]