From c41d47cda01ef36389de947e3ba29c3df36bf6b7 Mon Sep 17 00:00:00 2001 From: larsundso Date: Thu, 5 Sep 2024 23:35:59 +0200 Subject: [PATCH] Dockerize --- Dockerfile | 9 +++++++++ entrypoint.sh | 3 +++ package.json | 4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 Dockerfile create mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..70c60589 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM node:22 +WORKDIR /app +RUN corepack enable +COPY . . +WORKDIR /app/packages/Bot +RUN pnpm install +RUN pnpx prisma generate +RUN pnpm build +COPY ./packages/Bot/.env /app/packages/Bot/.env.template \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 00000000..5902a362 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,3 @@ +apt install -y gettext +envsubst < ./.env.template > ./.env +pnpm start \ No newline at end of file diff --git a/package.json b/package.json index e9d7bf4d..f1a8581c 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "lint": "npx eslint 'src/**/*.ts' --fix", "register": "node ./dist/register-commands.js", "run": "node --max-old-space-size=10240 --no-deprecation --no-warnings --experimental-json-modules ./dist/index.js", - "prestart": "rm -rf dist && pnpm build", + "prestart": "rm -rf dist && pnpm build && pnpx prisma db push", "start": "pnpm run run", "watch": "swc src -d dist --strip-leading-paths --copy-files --watch" }, @@ -21,7 +21,7 @@ "@total-typescript/ts-reset": "^0.6.1", "@types/lodash": "^4.17.7", "@types/lodash.merge": "^4.6.9", - "captcha-canvas": "github:Larsundso/captcha-canvas", + "captcha-canvas": "^2.3.1", "client@latest": "link:prisma/client@latest", "discord-api-types": "0.37.99", "discord-hybrid-sharding": "^2.2.0",