Skip to content

Commit 31d681b

Browse files
authored
Merge pull request #2 from dgraph-io/akash/nodemon
feat: add pm2 to restart server on script change
2 parents bc6ec79 + fae056d commit 31d681b

File tree

7 files changed

+1852
-767
lines changed

7 files changed

+1852
-767
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ RUN adduser app -h /app -D
1919
USER app
2020
WORKDIR /app
2121
COPY --from=build --chown=app /app /app
22-
CMD ["node", "."]
22+
CMD ["npm", "start"]

ecosystem.config.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
apps: [
3+
{
4+
name: "dgraph-lambda",
5+
script: "./dist/index.js",
6+
instances: 4,
7+
exp_backoff_restart_delay: 100,
8+
max_memory_restart: "32M",
9+
watch: ["./script/script.js"],
10+
watch_options: {
11+
followSymlinks: false,
12+
},
13+
exec_mode: "cluster",
14+
env: {
15+
NODE_ENV: "development",
16+
},
17+
env_production: {
18+
NODE_ENV: "production",
19+
},
20+
},
21+
],
22+
};

0 commit comments

Comments
 (0)