egg
egg copied to clipboard
Dockerizing egg.js
Is the following steps enough to Dockerizing egg.js application?
Removing --daemon
in the start script in the package.json
"scripts": {
"start": "egg-scripts start --title=egg-server-app",
},
Using the following docker file
FROM node:16
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
RUN npm install
# If you are building your code for production
# RUN npm ci --only=production
# Bundle app source
COPY . .
EXPOSE 80
CMD [ "npm", "run" , "start" ]
I am asking about CMD [ "npm", "run" , "start" ]
part