egg icon indicating copy to clipboard operation
egg copied to clipboard

Dockerizing egg.js

Open sm2017 opened this issue 2 years ago • 3 comments

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

sm2017 avatar Nov 29 '21 14:11 sm2017