diff --git a/game/client/Dockerfile b/game/client/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..96e141a64e69b3f73e3606dbdf1d34fbb1fddda6 --- /dev/null +++ b/game/client/Dockerfile @@ -0,0 +1,20 @@ +# Use official Node image +FROM node:20-alpine + +# Set working directory +WORKDIR /app + +# Copy package.json and lock file +COPY package*.json ./ + +# Install dependencies +RUN npm install + +# Copy the rest of the source code +COPY . . + +# Expose Vite dev server port +EXPOSE 5173 + +# Start Vite dev server +CMD ["npm", "run", "dev", "--", "--host"] diff --git a/game/client/README.md b/game/client/README.md deleted file mode 100644 index d2e77611fd3d959fee0487c41bd27b318be32b04..0000000000000000000000000000000000000000 --- a/game/client/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# React + TypeScript + Vite - -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. - -Currently, two official plugins are available: - -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh - -## React Compiler - -The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation). - -## Expanding the ESLint configuration - -If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: - -```js -export default defineConfig([ - globalIgnores(['dist']), - { - files: ['**/*.{ts,tsx}'], - extends: [ - // Other configs... - - // Remove tseslint.configs.recommended and replace with this - tseslint.configs.recommendedTypeChecked, - // Alternatively, use this for stricter rules - tseslint.configs.strictTypeChecked, - // Optionally, add this for stylistic rules - tseslint.configs.stylisticTypeChecked, - - // Other configs... - ], - languageOptions: { - parserOptions: { - project: ['./tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: import.meta.dirname, - }, - // other options... - }, - }, -]) -``` - -You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: - -```js -// eslint.config.js -import reactX from 'eslint-plugin-react-x' -import reactDom from 'eslint-plugin-react-dom' - -export default defineConfig([ - globalIgnores(['dist']), - { - files: ['**/*.{ts,tsx}'], - extends: [ - // Other configs... - // Enable lint rules for React - reactX.configs['recommended-typescript'], - // Enable lint rules for React DOM - reactDom.configs.recommended, - ], - languageOptions: { - parserOptions: { - project: ['./tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: import.meta.dirname, - }, - // other options... - }, - }, -]) -``` diff --git a/game/client/vite.config.ts b/game/client/vite.config.ts index 8b0f57b91aeb45c54467e29f983a0893dc83c4d9..54607076b6bd6457eb545d4376c35e12af4f6735 100644 --- a/game/client/vite.config.ts +++ b/game/client/vite.config.ts @@ -4,4 +4,8 @@ import react from '@vitejs/plugin-react' // https://vite.dev/config/ export default defineConfig({ plugins: [react()], + server: { + port: 5173, + host: true, + }, }) diff --git a/monitor/client/Dockerfile b/monitor/client/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..2510a9114336ea7ca970b5c50dde822f18328d62 --- /dev/null +++ b/monitor/client/Dockerfile @@ -0,0 +1,20 @@ +# Use official Node image +FROM node:20-alpine + +# Set working directory +WORKDIR /app + +# Copy package.json and lock file +COPY package*.json ./ + +# Install dependencies +RUN npm install + +# Copy the rest of the source code +COPY . . + +# Expose Vite dev server port +EXPOSE 5174 + +# Start Vite dev server +CMD ["npm", "run", "dev", "--", "--host"] diff --git a/monitor/client/README.md b/monitor/client/README.md deleted file mode 100644 index d2e77611fd3d959fee0487c41bd27b318be32b04..0000000000000000000000000000000000000000 --- a/monitor/client/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# React + TypeScript + Vite - -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. - -Currently, two official plugins are available: - -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh - -## React Compiler - -The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation). - -## Expanding the ESLint configuration - -If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: - -```js -export default defineConfig([ - globalIgnores(['dist']), - { - files: ['**/*.{ts,tsx}'], - extends: [ - // Other configs... - - // Remove tseslint.configs.recommended and replace with this - tseslint.configs.recommendedTypeChecked, - // Alternatively, use this for stricter rules - tseslint.configs.strictTypeChecked, - // Optionally, add this for stylistic rules - tseslint.configs.stylisticTypeChecked, - - // Other configs... - ], - languageOptions: { - parserOptions: { - project: ['./tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: import.meta.dirname, - }, - // other options... - }, - }, -]) -``` - -You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: - -```js -// eslint.config.js -import reactX from 'eslint-plugin-react-x' -import reactDom from 'eslint-plugin-react-dom' - -export default defineConfig([ - globalIgnores(['dist']), - { - files: ['**/*.{ts,tsx}'], - extends: [ - // Other configs... - // Enable lint rules for React - reactX.configs['recommended-typescript'], - // Enable lint rules for React DOM - reactDom.configs.recommended, - ], - languageOptions: { - parserOptions: { - project: ['./tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: import.meta.dirname, - }, - // other options... - }, - }, -]) -``` diff --git a/monitor/client/vite.config.ts b/monitor/client/vite.config.ts index 8b0f57b91aeb45c54467e29f983a0893dc83c4d9..22efc6d6c9ed2a44c5167bbb88346f7d9e493b4b 100644 --- a/monitor/client/vite.config.ts +++ b/monitor/client/vite.config.ts @@ -4,4 +4,8 @@ import react from '@vitejs/plugin-react' // https://vite.dev/config/ export default defineConfig({ plugins: [react()], + server: { + port: 5174, + host: true, + }, })