Skip to content

Commit

Permalink
chore: add dockerfile and pm2
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-737 committed Mar 12, 2024
1 parent c7c2995 commit 093962d
Show file tree
Hide file tree
Showing 5 changed files with 1,630 additions and 185 deletions.
13 changes: 13 additions & 0 deletions .ecosystem.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export default {
apps: [
{
name: "interchat",
script: "build/index.js",
env_production: {
NODE_ENV: "production"
},
autorestart: true
}
]
};

22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM node:21-alpine

WORKDIR /app

COPY .env.docke[r] ./.env
COPY package.json .
COPY .yarn ./.yarn
COPY locales ./locales
COPY yarn.lock .

RUN yarn

COPY tsconfig.json .
COPY src ./src
COPY prisma ./prisma
COPY ecosystem.config.js .

RUN yarn build
RUN npm prune --production

EXPOSE 443
CMD ["yarn", "start"]
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"license": "GPL-3.0-or-later",
"scripts": {
"start": "node .",
"start:prod": "pm2 start .ecosystem.config.js",
"build": "tsc --build",
"dev": "tsc-watch --outDir ./build --onSuccess \"node --trace-warnings .\"",
"register:commands": "node build/utils/RegisterCmdCli.js",
Expand All @@ -18,8 +19,8 @@
},
"type": "module",
"dependencies": {
"@prisma/client": "^5.10.2",
"@sentry/node": "^7.106.0",
"@prisma/client": "^5.11.0",
"@sentry/node": "^7.106.1",
"@tensorflow/tfjs-node": "^4.17.0",
"@top-gg/sdk": "^3.1.6",
"common-tags": "^1.8.2",
Expand All @@ -34,6 +35,7 @@
"lz-string": "^1.5.0",
"nsfwjs": "^3.0.0",
"parse-duration": "^1.1.0",
"pm2": "^5.3.1",
"sharp": "^0.33.2",
"source-map-support": "^0.5.21",
"winston": "^3.12.0"
Expand All @@ -44,19 +46,19 @@
"@types/express": "^4.17.21",
"@types/i18n": "^0.13.10",
"@types/js-yaml": "^4.0.9",
"@types/lodash": "^4.14.202",
"@types/node": "^20.11.25",
"@types/lodash": "^4.17.0",
"@types/node": "^20.11.26",
"@types/source-map-support": "^0.5.10",
"cz-conventional-changelog": "^3.3.0",
"eslint": "8.57.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"prisma": "^5.10.2",
"prisma": "^5.11.0",
"standard-version": "^9.5.0",
"tsc-watch": "^6.0.4",
"typescript": "^5.4.2",
"typescript-eslint": "^7.1.1"
"typescript-eslint": "^7.2.0"
},
"config": {
"commitizen": {
Expand Down
2 changes: 1 addition & 1 deletion src/managers/CommandManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default class CommandManager extends Factory {
}
else if (file.endsWith('.js') && file !== 'BaseCommand.js') {
const imported = await import(importPrefix + filePath);
const command = new imported.default();
const command: BaseCommand = new imported.default();

// if the command extends BaseCommand (ie. is not a subcommand), add it to the commands map
if (Object.getPrototypeOf(command.constructor) === BaseCommand) {
Expand Down
Loading

0 comments on commit 093962d

Please sign in to comment.