Skip to content

Commit 6a496dc

Browse files
committed
ci: add Dockerfile && .dockerignore
Ref: - eggjs/egg#1431 - https://eggjs.org/zh-cn/core/deployment.html
1 parent 20e3df6 commit 6a496dc

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

Diff for: .dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
npm-debug.log

Diff for: Dockerfile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM node:carbon
2+
3+
WORKDIR /usr/src/app
4+
5+
# Install app dependencies
6+
# A wildcard is used to ensure both package.json AND package-lock.json are copied
7+
# where available (npm@5+)
8+
COPY package*.json ./
9+
10+
# RUN npm install
11+
# If you are building your code for production
12+
RUN npm install --only=production
13+
14+
# Bundle app source
15+
COPY . .
16+
17+
EXPOSE 7001
18+
19+
CMD [ "npm", "run", "start:docker"]

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
},
2323
"scripts": {
2424
"start": "egg-scripts start --daemon --title=egg-server-smart-signature-server",
25+
"start:docker": "egg-scripts start",
2526
"stop": "egg-scripts stop --title=egg-server-smart-signature-server",
2627
"dev": "egg-bin dev",
2728
"debug": "egg-bin debug",

0 commit comments

Comments
 (0)