chore: uses pm2 to start Anonymous GitHub in docker

This commit is contained in:
tdurieux
2021-09-07 08:39:15 +02:00
parent e4c7053186
commit 0f8572fe01
3 changed files with 19 additions and 2 deletions

View File

@@ -5,13 +5,18 @@ EXPOSE $PORT
WORKDIR /app
RUN npm install pm2 -g
RUN pm2 install typescript
COPY package.json .
COPY package-lock.json .
RUN npm install
COPY ecosystem.config.js .
COPY healthcheck.js .
COPY src .
COPY index.ts .
COPY public .
CMD [ "npm", "run", "start" ]
CMD [ "pm2-runtime", "ecosystem.config.js"]

View File

@@ -4,7 +4,6 @@ services:
anonymous_github:
build: .
restart: always
command: nodemon --transpile-only index.ts
image: tdurieux/anonymous_github:v2
env_file:
- ./.env

13
ecosystem.config.js Normal file
View File

@@ -0,0 +1,13 @@
module.exports = {
apps: [
{
name: "AnonymousGitHub",
script: "./index.ts",
exec_mode: "fork",
watch: true,
interpreter: "node",
interpreter_args:
"--require ts-node/register",
},
],
};