eggjs / eggjs/egg

Dockerizing egg.js

Open
#4,817 3 comments 0 reactions 0 assignees View on GitHub
Inactive
Dominant language
TypeScript
Stars
19k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Is the following steps enough to Dockerizing egg.js application?

#### Removing `--daemon` in the start script in the `package.json`
```json
"scripts": {
"start": "egg-scripts start --title=egg-server-app",
},
```

#### Using the following docker file

```dockerfile
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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.