diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9b49524 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,15 @@ +node_modules +Dockerfile* +docker-compose* +.dockerignore +.git +.gitignore +README.md +LICENSE +.vscode +Makefile +helm-charts +.env +.editorconfig +.idea +coverage* \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..88eac0e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM oven/bun:1 AS base +WORKDIR /usr/src/app + +FROM base AS install +RUN mkdir -p /temp/prod +COPY package.json bun.lockb /temp/prod/ +RUN cd /temp/prod && bun install --frozen-lockfile + +# copy node_modules from temp directory +# then copy all (non-ignored) project files into the image +FROM base AS prerelease +COPY --from=install /temp/prod/node_modules node_modules +COPY . . + +RUN bun run build + +FROM base AS release +COPY --from=install /temp/prod/node_modules node_modules +COPY --from=prerelease /usr/src/app/build . +COPY --from=prerelease /usr/src/app/package.json . +RUN ls . +USER bun +EXPOSE 3000/tcp +ENTRYPOINT [ "bun", "run", "index.js" ] \ No newline at end of file diff --git a/README.md b/README.md index 4b027d4..9f635e9 100644 --- a/README.md +++ b/README.md @@ -33,3 +33,13 @@ A CSV file that looks like this: Explanation: In the class `com.fsck.k9.FontSizes` in the example above, 13.5% of its methods exhibit *presentation layer* indications, 81.1% exhibits *domain layer* indications, and 5.4% methods with *data source layer* indications. For examples complete files that can be loaded into the visualisation, see: [data/bubbletea-viz](https://github.com/rsatrioadi/phd/tree/main/data/bubbletea-viz) + +## How to run using docker +1. Build the docker image +```bash +docker build -t bubbletea-viz . +``` +2. Run the docker image +```bash +docker run -p 3000:3000 bubbletea-viz +``` diff --git a/bun.lockb b/bun.lockb index e649656..710488e 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index eff2b23..e4b3d8f 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "d3": "^7.9.0", "lucide-svelte": "^0.378.0", "paneforge": "^0.0.4", + "svelte-adapter-bun": "^0.5.2", "tailwind-merge": "^2.3.0", "tailwind-variants": "^0.2.1" } diff --git a/svelte.config.js b/svelte.config.js index 4a82086..3d8ec7f 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,4 +1,4 @@ -import adapter from '@sveltejs/adapter-auto'; +import adapter from 'svelte-adapter-bun'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; /** @type {import('@sveltejs/kit').Config} */