From 0b2f4b7e6231a633435fe6a8a8af980c190355e9 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Tue, 17 Oct 2023 19:41:42 +0800 Subject: [PATCH] chore: add dockerfile --- Dockerfile | 15 +++++++++++++++ package.json | 1 + src/server/router/workspace.ts | 2 -- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1ec915e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:lts-alpine + +WORKDIR /app/tailchat + +RUN npm install -g pnpm@8.3.1 + +COPY . . + +RUN pnpm install --frozen-lockfile + +RUN pnpm build + +EXPOSE 12345 + +CMD ["pnpm", "start:pro"] diff --git a/package.json b/package.json index 42a462b..d1b5444 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "scripts": { "dev": "nodemon", "start": "NODE_ENV=production ts-node src/server/main.ts", + "start:pro": "node ./dist/server/main.js", "build": "pnpm build:client && pnpm build:server && pnpm build:tracker && pnpm build:geo", "build:client": "vite build", "build:server": "tsc -p tsconfig.server.json", diff --git a/src/server/router/workspace.ts b/src/server/router/workspace.ts index 667a0e8..6594a6a 100644 --- a/src/server/router/workspace.ts +++ b/src/server/router/workspace.ts @@ -6,12 +6,10 @@ import { workspacePermission } from '../middleware/workspace'; import { addWorkspaceWebsite, deleteWorkspaceWebsite, - getWorkspaceWebsiteInfo, getWorkspaceWebsitePageview, getWorkspaceWebsites, getWorkspaceWebsiteSession, getWorkspaceWebsiteStats, - updateWorkspaceWebsiteInfo, } from '../model/workspace'; import { parseDateRange } from '../utils/common'; import { ROLES } from '../utils/const';