From fbf4bfc8c03d6dc0c791a87f37d168f63b39909e Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Wed, 3 Sep 2025 07:00:53 -0500 Subject: [PATCH 1/9] switch to adapter-node --- package.json | 2 +- pnpm-lock.yaml | 160 ++++++++++++++++++++++++++++++++++++++++++++--- svelte.config.js | 2 +- 3 files changed, 155 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index f6215c5..3c7a3e9 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@lucide/svelte": "0.542.0", "@oddbird/css-anchor-positioning": "0.6.1", "@playwright/test": "1.55.0", - "@sveltejs/adapter-auto": "6.1.0", + "@sveltejs/adapter-node": "5.3.1", "@sveltejs/kit": "2.37.0", "@sveltejs/vite-plugin-svelte": "6.1.4", "@testing-library/svelte": "5.2.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8b278b0..dc272f2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,9 +29,9 @@ importers: '@playwright/test': specifier: 1.55.0 version: 1.55.0 - '@sveltejs/adapter-auto': - specifier: 6.1.0 - version: 6.1.0(@sveltejs/kit@2.37.0(@opentelemetry/api@1.9.0)(@sveltejs/vite-plugin-svelte@6.1.4(svelte@5.38.6)(vite@7.1.4(@types/node@24.3.0)(jiti@2.5.1)))(svelte@5.38.6)(vite@7.1.4(@types/node@24.3.0)(jiti@2.5.1))) + '@sveltejs/adapter-node': + specifier: 5.3.1 + version: 5.3.1(@sveltejs/kit@2.37.0(@opentelemetry/api@1.9.0)(@sveltejs/vite-plugin-svelte@6.1.4(svelte@5.38.6)(vite@7.1.4(@types/node@24.3.0)(jiti@2.5.1)))(svelte@5.38.6)(vite@7.1.4(@types/node@24.3.0)(jiti@2.5.1))) '@sveltejs/kit': specifier: 2.37.0 version: 2.37.0(@opentelemetry/api@1.9.0)(@sveltejs/vite-plugin-svelte@6.1.4(svelte@5.38.6)(vite@7.1.4(@types/node@24.3.0)(jiti@2.5.1)))(svelte@5.38.6)(vite@7.1.4(@types/node@24.3.0)(jiti@2.5.1)) @@ -453,6 +453,42 @@ packages: '@remirror/core-constants@3.0.0': resolution: {integrity: sha512-42aWfPrimMfDKDi4YegyS7x+/0tlzaqwPQCULLanv3DMIlu96KTJR0fM5isWX2UViOqlGnX6YFgqWepcX+XMNg==} + '@rollup/plugin-commonjs@28.0.6': + resolution: {integrity: sha512-XSQB1K7FUU5QP+3lOQmVCE3I0FcbbNvmNT4VJSj93iUjayaARrTQeoRdiYQoftAJBLrR9t2agwAd3ekaTgHNlw==} + engines: {node: '>=16.0.0 || 14 >= 14.17'} + peerDependencies: + rollup: ^2.68.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + + '@rollup/plugin-json@6.1.0': + resolution: {integrity: sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + + '@rollup/plugin-node-resolve@16.0.1': + resolution: {integrity: sha512-tk5YCxJWIG81umIvNkSod2qK5KyQW19qcBF/B78n1bjtOON6gzKoVeSzAE8yHCZEDmqkHKkxplExA8KzdJLJpA==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^2.78.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + + '@rollup/pluginutils@5.2.0': + resolution: {integrity: sha512-qWJ2ZTbmumwiLFomfzTyt5Kng4hwPi9rwCYN4SHb6eaRU1KNO4ccxINHr/VhH4GgPlt1XfSTLX2LBTme8ne4Zw==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + '@rollup/rollup-android-arm-eabi@4.50.0': resolution: {integrity: sha512-lVgpeQyy4fWN5QYebtW4buT/4kn4p4IJ+kDNB4uYNT5b8c8DLJDg6titg20NIg7E8RWwdWZORW6vUFfrLyG3KQ==} cpu: [arm] @@ -575,10 +611,10 @@ packages: peerDependencies: acorn: ^8.9.0 - '@sveltejs/adapter-auto@6.1.0': - resolution: {integrity: sha512-shOuLI5D2s+0zTv2ab5M5PqfknXqWbKi+0UwB9yLTRIdzsK1R93JOO8jNhIYSHdW+IYXIYnLniu+JZqXs7h9Wg==} + '@sveltejs/adapter-node@5.3.1': + resolution: {integrity: sha512-PSoGfa9atkmuixe7jvuS2tsUohVZF20So87ASzfMRGTTNqEd8s48KAodlv3CzHwq9XO/BM8KsQLpqqsr/6dmuA==} peerDependencies: - '@sveltejs/kit': ^2.0.0 + '@sveltejs/kit': ^2.4.0 '@sveltejs/kit@2.37.0': resolution: {integrity: sha512-xgKtpjQ6Ry4mdShd01ht5AODUsW7+K1iValPDq7QX8zI1hWOKREH9GjG8SRCN5tC4K7UXmMhuQam7gbLByVcnw==} @@ -692,6 +728,9 @@ packages: resolution: {integrity: sha512-++krMS5bt3SxNOqjrftispPLRkvfXXw2BtVq4VPJ8Vpf+Sne1MhxVoj0EFCM+14MFlX0EHYQvX3k9AaQzob9ZQ==} deprecated: This is a stub types definition. prosemirror-transform provides its own type definitions, so you do not need this installed. + '@types/resolve@1.20.2': + resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} + '@typescript-eslint/eslint-plugin@8.42.0': resolution: {integrity: sha512-Aq2dPqsQkxHOLfb2OPv43RnIvfj05nw8v/6n3B2NABIPpHnjQnaLo9QGMTvml+tv4korl/Cjfrb/BYhoL8UUTQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -902,6 +941,9 @@ packages: color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + commondir@1.0.1: + resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} + concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} @@ -1041,6 +1083,9 @@ packages: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} + estree-walker@2.0.2: + resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + estree-walker@3.0.3: resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} @@ -1109,6 +1154,9 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -1143,6 +1191,10 @@ packages: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} @@ -1159,6 +1211,10 @@ packages: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} + is-core-module@2.16.1: + resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} + engines: {node: '>= 0.4'} + is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -1167,10 +1223,16 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + is-module@1.0.0: + resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} + is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} + is-reference@1.2.1: + resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} + is-reference@3.0.3: resolution: {integrity: sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==} @@ -1377,6 +1439,9 @@ packages: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} + path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + pathe@2.0.3: resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} @@ -1554,6 +1619,11 @@ packages: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} + resolve@1.22.10: + resolution: {integrity: sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==} + engines: {node: '>= 0.4'} + hasBin: true + reusify@1.1.0: resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} @@ -1620,6 +1690,10 @@ packages: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} + supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + svelte-check@4.3.1: resolution: {integrity: sha512-lkh8gff5gpHLjxIV+IaApMxQhTGnir2pNUAqcNgeKkvK5bT/30Ey/nzBxNLDlkztCH4dP7PixkMt9SWEKFPBWg==} engines: {node: '>= 18.0.0'} @@ -2112,6 +2186,42 @@ snapshots: '@remirror/core-constants@3.0.0': {} + '@rollup/plugin-commonjs@28.0.6(rollup@4.50.0)': + dependencies: + '@rollup/pluginutils': 5.2.0(rollup@4.50.0) + commondir: 1.0.1 + estree-walker: 2.0.2 + fdir: 6.5.0(picomatch@4.0.3) + is-reference: 1.2.1 + magic-string: 0.30.18 + picomatch: 4.0.3 + optionalDependencies: + rollup: 4.50.0 + + '@rollup/plugin-json@6.1.0(rollup@4.50.0)': + dependencies: + '@rollup/pluginutils': 5.2.0(rollup@4.50.0) + optionalDependencies: + rollup: 4.50.0 + + '@rollup/plugin-node-resolve@16.0.1(rollup@4.50.0)': + dependencies: + '@rollup/pluginutils': 5.2.0(rollup@4.50.0) + '@types/resolve': 1.20.2 + deepmerge: 4.3.1 + is-module: 1.0.0 + resolve: 1.22.10 + optionalDependencies: + rollup: 4.50.0 + + '@rollup/pluginutils@5.2.0(rollup@4.50.0)': + dependencies: + '@types/estree': 1.0.8 + estree-walker: 2.0.2 + picomatch: 4.0.3 + optionalDependencies: + rollup: 4.50.0 + '@rollup/rollup-android-arm-eabi@4.50.0': optional: true @@ -2190,9 +2300,13 @@ snapshots: dependencies: acorn: 8.15.0 - '@sveltejs/adapter-auto@6.1.0(@sveltejs/kit@2.37.0(@opentelemetry/api@1.9.0)(@sveltejs/vite-plugin-svelte@6.1.4(svelte@5.38.6)(vite@7.1.4(@types/node@24.3.0)(jiti@2.5.1)))(svelte@5.38.6)(vite@7.1.4(@types/node@24.3.0)(jiti@2.5.1)))': + '@sveltejs/adapter-node@5.3.1(@sveltejs/kit@2.37.0(@opentelemetry/api@1.9.0)(@sveltejs/vite-plugin-svelte@6.1.4(svelte@5.38.6)(vite@7.1.4(@types/node@24.3.0)(jiti@2.5.1)))(svelte@5.38.6)(vite@7.1.4(@types/node@24.3.0)(jiti@2.5.1)))': dependencies: + '@rollup/plugin-commonjs': 28.0.6(rollup@4.50.0) + '@rollup/plugin-json': 6.1.0(rollup@4.50.0) + '@rollup/plugin-node-resolve': 16.0.1(rollup@4.50.0) '@sveltejs/kit': 2.37.0(@opentelemetry/api@1.9.0)(@sveltejs/vite-plugin-svelte@6.1.4(svelte@5.38.6)(vite@7.1.4(@types/node@24.3.0)(jiti@2.5.1)))(svelte@5.38.6)(vite@7.1.4(@types/node@24.3.0)(jiti@2.5.1)) + rollup: 4.50.0 '@sveltejs/kit@2.37.0(@opentelemetry/api@1.9.0)(@sveltejs/vite-plugin-svelte@6.1.4(svelte@5.38.6)(vite@7.1.4(@types/node@24.3.0)(jiti@2.5.1)))(svelte@5.38.6)(vite@7.1.4(@types/node@24.3.0)(jiti@2.5.1))': dependencies: @@ -2333,6 +2447,8 @@ snapshots: dependencies: prosemirror-transform: 1.10.4 + '@types/resolve@1.20.2': {} + '@typescript-eslint/eslint-plugin@8.42.0(@typescript-eslint/parser@8.42.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)': dependencies: '@eslint-community/regexpp': 4.12.1 @@ -2592,6 +2708,8 @@ snapshots: color-name@1.1.4: {} + commondir@1.0.1: {} + concat-map@0.0.1: {} cookie@0.6.0: {} @@ -2763,6 +2881,8 @@ snapshots: estraverse@5.3.0: {} + estree-walker@2.0.2: {} + estree-walker@3.0.3: dependencies: '@types/estree': 1.0.8 @@ -2821,6 +2941,8 @@ snapshots: fsevents@2.3.3: optional: true + function-bind@1.1.2: {} + glob-parent@5.1.2: dependencies: is-glob: 4.0.3 @@ -2845,6 +2967,10 @@ snapshots: has-flag@4.0.0: {} + hasown@2.0.2: + dependencies: + function-bind: 1.1.2 + ignore@5.3.2: {} ignore@7.0.5: {} @@ -2856,14 +2982,24 @@ snapshots: imurmurhash@0.1.4: {} + is-core-module@2.16.1: + dependencies: + hasown: 2.0.2 + is-extglob@2.1.1: {} is-glob@4.0.3: dependencies: is-extglob: 2.1.1 + is-module@1.0.0: {} + is-number@7.0.0: {} + is-reference@1.2.1: + dependencies: + '@types/estree': 1.0.8 + is-reference@3.0.3: dependencies: '@types/estree': 1.0.8 @@ -3017,6 +3153,8 @@ snapshots: path-key@3.1.1: {} + path-parse@1.0.7: {} + pathe@2.0.3: {} pathval@2.0.1: {} @@ -3220,6 +3358,12 @@ snapshots: resolve-from@4.0.0: {} + resolve@1.22.10: + dependencies: + is-core-module: 2.16.1 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + reusify@1.1.0: {} rfc6902@3.1.1: {} @@ -3295,6 +3439,8 @@ snapshots: dependencies: has-flag: 4.0.0 + supports-preserve-symlinks-flag@1.0.0: {} + svelte-check@4.3.1(picomatch@4.0.3)(svelte@5.38.6)(typescript@5.9.2): dependencies: '@jridgewell/trace-mapping': 0.3.30 diff --git a/svelte.config.js b/svelte.config.js index 8f0f9da..c1c25fe 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,4 +1,4 @@ -import adapter from '@sveltejs/adapter-auto'; +import adapter from '@sveltejs/adapter-node'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; /** @type {import('@sveltejs/kit').Config} */ From 82774650f8b55e695ade36399041d3d7e14e1dab Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Wed, 3 Sep 2025 07:05:22 -0500 Subject: [PATCH 2/9] prepare Dockerfile --- Dockerfile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4c3e859 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM node:24 AS build + +RUN npm install -g pnpm + +ENV NODE_ENV=production + +# Install deps +COPY package.json pnpm-lock.yaml /app/ +WORKDIR /app +RUN pnpm install + +# Build the app +COPY . /app +RUN pnpm run build + +# Prepare production image +FROM node:24 + +RUN npm install -g pnpm + +COPY package.json pnpm-lock.yaml /app/ +WORKDIR /app +RUN pnpm install + +COPY --from=build /app/build /app +WORKDIR /app +CMD ["node", "index.js"] From 7801017ca3f68d4b3ca619654c71faa1b4c1840a Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Wed, 3 Sep 2025 07:12:22 -0500 Subject: [PATCH 3/9] set production context --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4c3e859..e50bf60 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,11 +16,13 @@ RUN pnpm run build # Prepare production image FROM node:24 +ENV NODE_ENV=production + RUN npm install -g pnpm COPY package.json pnpm-lock.yaml /app/ WORKDIR /app -RUN pnpm install +RUN pnpm install --production COPY --from=build /app/build /app WORKDIR /app From e3900b8a4f6bba7dbbe4c190eefe20439c703a30 Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Wed, 3 Sep 2025 07:12:45 -0500 Subject: [PATCH 4/9] ignore big context and Dockerfile itself --- .dockerignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..210c47a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules +Dockerfile From 765a0bd28303a6c5b2ea7e24775db94257fd55c9 Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Wed, 3 Sep 2025 07:13:19 -0500 Subject: [PATCH 5/9] name stage for better logging --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e50bf60..05102ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ COPY . /app RUN pnpm run build # Prepare production image -FROM node:24 +FROM node:24 AS run ENV NODE_ENV=production From f801d7ec60b8998c23561e5eba5a539c0e74c88e Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Wed, 3 Sep 2025 07:25:52 -0500 Subject: [PATCH 6/9] add a health check route --- src/routes/health/+server.ts | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/routes/health/+server.ts diff --git a/src/routes/health/+server.ts b/src/routes/health/+server.ts new file mode 100644 index 0000000..a335585 --- /dev/null +++ b/src/routes/health/+server.ts @@ -0,0 +1,3 @@ +import type { RequestHandler } from './$types'; + +export const GET: RequestHandler = () => new Response('OK'); From f9359cb285f49475152efbf5221c9e666873db29 Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Wed, 3 Sep 2025 07:28:09 -0500 Subject: [PATCH 7/9] add a test for the container --- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32414a7..bc9462e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,3 +40,42 @@ jobs: name: playwright-report path: playwright-report/ retention-days: 30 + + container: + name: Container + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - run: docker build -t blocks:test . + + - name: run and check + run: | + docker run -d --name blocks -p 3000:3000 blocks:test + + # Wait for container to be ready (up to 30 seconds) + echo "Waiting for container to start..." + for i in {1..30}; do + if curl -f -s http://localhost:3000 > /dev/null 2>&1; then + echo "Container is ready!" + break + fi + echo "Attempt $i/30: Container not ready yet, waiting..." + sleep 1 + done + + - name: health check + run: | + echo "Checking health..." + RESP="$(curl -fs http://localhost:5173/health)" + if test "$RESP" != "OK"; then + printf "Health check failed! Here's what we got:\n\n%s\n\n" "$RESP" + exit 1 + fi + echo "Health check passed!" + + - name: stop container + if: always() + run: | + echo "Stopping Docker container..." + docker stop blocks || true + docker rm blocks || true From a7e5a0c82c0fbfb9401d8d99f21c9f6081bb8545 Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Wed, 3 Sep 2025 07:29:55 -0500 Subject: [PATCH 8/9] dont --fail --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc9462e..5146c52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,7 +66,7 @@ jobs: - name: health check run: | echo "Checking health..." - RESP="$(curl -fs http://localhost:5173/health)" + RESP="$(curl -Ss http://localhost:5173/health)" if test "$RESP" != "OK"; then printf "Health check failed! Here's what we got:\n\n%s\n\n" "$RESP" exit 1 From 7e8bf512f1dd8944ce4b2686bbe59670bbd81719 Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Wed, 3 Sep 2025 07:31:32 -0500 Subject: [PATCH 9/9] use the right port --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5146c52..2b28a3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,7 +66,7 @@ jobs: - name: health check run: | echo "Checking health..." - RESP="$(curl -Ss http://localhost:5173/health)" + RESP="$(curl -Ss http://localhost:3000/health)" if test "$RESP" != "OK"; then printf "Health check failed! Here's what we got:\n\n%s\n\n" "$RESP" exit 1