From 60fa2773b5e341d564d2d489cdcfc348e889744b Mon Sep 17 00:00:00 2001 From: tailuge Date: Mon, 23 Dec 2024 09:28:42 +0000 Subject: [PATCH] tidy --- README.md | 6 ++++-- dist/Dockerfile | 3 --- package.json | 2 +- src/diagram/throw_gpt4o.ts | 8 ++++---- src/network/server/Dockerfile | 4 ++-- 5 files changed, 11 insertions(+), 12 deletions(-) delete mode 100644 dist/Dockerfile diff --git a/README.md b/README.md index 98bd7cad..12637583 100644 --- a/README.md +++ b/README.md @@ -191,7 +191,7 @@ Some of the Mathaven equations not supplied by the paper were inferred by LLMs a ### Install ```shell -nvm use v18.17.1 +nvm use v22.12.0 yarn install yarn dev yarn gltfpack @@ -225,7 +225,9 @@ yarn prettify ### Two player ```shell -yarn websocket +yarn websocket #(for local dev) +yarn build:server +yarn start:server ``` the client uses query parameter ``?websocketserver=wss://some-host`` to locate diff --git a/dist/Dockerfile b/dist/Dockerfile deleted file mode 100644 index ad3bbe5f..00000000 --- a/dist/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM nginx - -COPY dist /usr/share/nginx/html \ No newline at end of file diff --git a/package.json b/package.json index a3f5e07c..654aba2d 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "websocket": "nodemon ./src/network/server/server.ts", "build:server": "webpack --config ./src/network/server/webpack.server.config.js", "start:server": "node dist/server.js", - "dockerify": "docker build -f dist/Dockerfile -t tailuge/billiards-nginx .", + "dockerify": "docker buildx build --platform linux/amd64 -f ./src/network/server/Dockerfile -t tailuge/billiards-network .", "gltfpack": "npx gltfpack -i dist/models/p8.gltf -o dist/models/p8.min.gltf && npx gltfpack -i dist/models/threecushion.gltf -o dist/models/threecushion.min.gltf && npx gltfpack -i dist/models/snooker.gltf -o dist/models/snooker.min.gltf && npx gltfpack -i dist/models/d-snooker.gltf -o dist/models/d-snooker.min.gltf" }, "nodemonConfig": { diff --git a/src/diagram/throw_gpt4o.ts b/src/diagram/throw_gpt4o.ts index 5f7511b2..d1897525 100644 --- a/src/diagram/throw_gpt4o.ts +++ b/src/diagram/throw_gpt4o.ts @@ -5,12 +5,12 @@ import { I, m } from "../model/physics/constants"; export class CollisionThrow { - public static R: number = 0.029; // ball radius in meters + public static readonly R: number = 0.029; // ball radius in meters // Friction parameters - private static a: number = 0.01; // Minimum friction coefficient - private static b: number = 0.108; // Range of friction variation - private static c: number = 1.088; // Decay rate + private static readonly a: number = 0.01; // Minimum friction coefficient + private static readonly b: number = 0.108; // Range of friction variation + private static readonly c: number = 1.088; // Decay rate private log; constructor(log: (...args: any[]) => void = () => { }) { diff --git a/src/network/server/Dockerfile b/src/network/server/Dockerfile index c97d3afe..7334e920 100644 --- a/src/network/server/Dockerfile +++ b/src/network/server/Dockerfile @@ -3,8 +3,8 @@ FROM node:22-alpine WORKDIR /app # Create a non-root user -RUN addgroup -S appgroup && adduser -S appuser -G appgroup -USER appuser +#RUN addgroup -S appgroup && adduser -S appuser -G appgroup +#USER appuser # Copy the entire repository into the container COPY . .