From 8abd3f1ce41408cb68d731d3adf8d0933aa05381 Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Tue, 15 Jul 2025 21:29:07 +0200 Subject: [PATCH] docker prep --- .dockerignore | 6 ++++++ Dockerfile | 23 +++++++++++++++++++++++ package.json | 3 ++- tsconfig.json | 15 ++++++++++----- 4 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3c961ce --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +* + +!src/ +!package.json +!bun.lock +!tsconfig.json diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..702b0b2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM oven/bun:1.2.18 AS base + +WORKDIR /app + +FROM base AS install +RUN mkdir -p /temp/dev +COPY package.json bun.lock /temp/dev/ +RUN cd /temp/dev && bun install --frozen-lockfile + +RUN mkdir -p /temp/prod +COPY package.json bun.lock /temp/prod/ +RUN cd /temp/prod && bun install --frozen-lockfile --production + +FROM base AS build +COPY --from=install /temp/dev/node_modules node_modules +COPY . . +RUN bun run build + +FROM base AS release +COPY --from=install /temp/prod/node_modules node_modules +COPY --from=build /app/dist . + +CMD [ "bun", "/app/main.js"] \ No newline at end of file diff --git a/package.json b/package.json index fff7e12..da889fc 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "check:spell": "cspell --config cspell.code.json **/*.ts", "lint": "eslint -c eslint.config.js .", "lint:fix": "eslint -c eslint.config.js --fix .", - "typecheck": "tsc --noEmit" + "typecheck": "tsc --noEmit", + "build": "tsc" }, "dependencies": { "@modelcontextprotocol/sdk": "^1.15.1", diff --git a/tsconfig.json b/tsconfig.json index 89ff0e3..54b8683 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,16 +3,15 @@ // Environment setup & latest features "lib": ["ESNext", "DOM"], "target": "ESNext", - "module": "Preserve", + "module": "ESNext", "moduleDetection": "force", "jsx": "react-jsx", "allowJs": true, // Bundler mode "moduleResolution": "bundler", - "allowImportingTsExtensions": true, "verbatimModuleSyntax": true, - "noEmit": true, + "noEmit": false, // Best practices "strict": true, @@ -24,6 +23,12 @@ // Some stricter flags (disabled by default) "noUnusedLocals": false, "noUnusedParameters": false, - "noPropertyAccessFromIndexSignature": false - } + "noPropertyAccessFromIndexSignature": false, + + "outDir": "./dist", + "rootDir": "./src", + "removeComments": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"] }