diff --git a/.dockerignore b/.dockerignore index 92589fe..c0dcd3d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,5 @@ dist -rush-character-archive/node_modules +frontend/node_modules vault/node_modules vault/src/proto -rush-character-archive/src/proto \ No newline at end of file +frontend/src/proto \ No newline at end of file diff --git a/build.log b/build.log new file mode 100644 index 0000000..1b8917c --- /dev/null +++ b/build.log @@ -0,0 +1,128 @@ +#0 building with "desktop-linux" instance using docker driver + +#1 [internal] load build definition from Dockerfile +#1 transferring dockerfile: 322B done +#1 DONE 0.0s + +#2 [internal] load metadata for docker.io/library/node:22.16 +#2 DONE 0.3s + +#3 [internal] load .dockerignore +#3 transferring context: 120B done +#3 DONE 0.0s + +#4 [ 1/10] FROM docker.io/library/node:22.16@sha256:71bcbb3b215b3fa84b5b167585675072f4c270855e37a599803f1a58141a0716 +#4 resolve docker.io/library/node:22.16@sha256:71bcbb3b215b3fa84b5b167585675072f4c270855e37a599803f1a58141a0716 0.0s done +#4 DONE 0.0s + +#5 [ 2/10] WORKDIR /srv/proto +#5 CACHED + +#6 [internal] load build context +#6 transferring context: 285.61kB 0.1s done +#6 DONE 0.1s + +#7 [ 3/10] COPY proto/ . +#7 DONE 0.8s + +#8 [ 4/10] WORKDIR /srv/frontend +#8 DONE 0.1s + +#9 [ 5/10] COPY frontend/package.json . +#9 DONE 0.1s + +#10 [ 6/10] RUN npm install +#10 10.52 +#10 10.52 added 328 packages, and audited 329 packages in 10s +#10 10.52 +#10 10.52 90 packages are looking for funding +#10 10.52 run `npm fund` for details +#10 10.52 +#10 10.52 found 0 vulnerabilities +#10 10.52 npm notice +#10 10.52 npm notice New major version of npm available! 10.9.2 -> 11.4.1 +#10 10.52 npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.4.1 +#10 10.52 npm notice To update run: npm install -g npm@11.4.1 +#10 10.52 npm notice +#10 DONE 11.1s + +#11 [ 7/10] COPY frontend/. . +#11 DONE 0.2s + +#12 [ 8/10] RUN npm i -g serve +#12 2.048 +#12 2.048 added 88 packages in 2s +#12 2.048 +#12 2.048 24 packages are looking for funding +#12 2.048 run `npm fund` for details +#12 DONE 2.1s + +#13 [ 9/10] RUN npm run build_protos +#13 0.279 +#13 0.279 > frontend@0.0.0 build_protos +#13 0.279 > mkdir -p src/proto & npx protoc -I=../proto/ --ts_out=server_grpc1:./src/proto --proto_path ../proto ../proto/*.proto +#13 0.279 +#13 1.394 @protobuf-ts/protoc installed protoc v31.1. +#13 DONE 1.8s + +#14 [10/10] RUN npm run build +#14 0.235 +#14 0.235 > frontend@0.0.0 build +#14 0.235 > run-p type-check "build-only {@}" -- +#14 0.235 +#14 0.323 +#14 0.323 > frontend@0.0.0 build-only +#14 0.323 > vite build +#14 0.323 +#14 0.325 +#14 0.325 > frontend@0.0.0 type-check +#14 0.325 > vue-tsc --build +#14 0.325 +#14 0.752 vite v6.3.5 building for production... +#14 0.805 transforming... +#14 1.191 ✓ 69 modules transformed. +#14 1.297 rendering chunks... +#14 1.301 computing gzip size... +#14 1.307 dist/index.html 0.43 kB │ gzip: 0.28 kB +#14 1.307 dist/assets/index-TXLObeWa.css 3.71 kB │ gzip: 1.19 kB +#14 1.307 dist/assets/index-0ixp9Wqt.js 105.33 kB │ gzip: 37.78 kB +#14 1.307 ✓ built in 530ms +#14 1.467 src/proto/character.grpc-server.ts(7,28): error TS2307: Cannot find module '@grpc/grpc-js' or its corresponding type declarations. +#14 1.467 src/proto/character.grpc-server.ts(38,30): error TS7006: Parameter 'bytes' implicitly has an 'any' type. +#14 1.467 src/proto/character.grpc-server.ts(39,29): error TS7006: Parameter 'bytes' implicitly has an 'any' type. +#14 1.467 src/proto/character.grpc-server.ts(40,28): error TS7006: Parameter 'value' implicitly has an 'any' type. +#14 1.467 src/proto/character.grpc-server.ts(40,37): error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +#14 1.467 src/proto/character.grpc-server.ts(41,27): error TS7006: Parameter 'value' implicitly has an 'any' type. +#14 1.467 src/proto/character.grpc-server.ts(41,36): error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +#14 1.467 src/proto/character.grpc-server.ts(48,30): error TS7006: Parameter 'bytes' implicitly has an 'any' type. +#14 1.467 src/proto/character.grpc-server.ts(49,29): error TS7006: Parameter 'bytes' implicitly has an 'any' type. +#14 1.467 src/proto/character.grpc-server.ts(50,28): error TS7006: Parameter 'value' implicitly has an 'any' type. +#14 1.467 src/proto/character.grpc-server.ts(50,37): error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +#14 1.467 src/proto/character.grpc-server.ts(51,27): error TS7006: Parameter 'value' implicitly has an 'any' type. +#14 1.467 src/proto/character.grpc-server.ts(51,36): error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +#14 1.485 ERROR: "type-check" exited with 2. +#14 ERROR: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1 +------ + > [10/10] RUN npm run build: +1.467 src/proto/character.grpc-server.ts(40,37): error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +1.467 src/proto/character.grpc-server.ts(41,27): error TS7006: Parameter 'value' implicitly has an 'any' type. +1.467 src/proto/character.grpc-server.ts(41,36): error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +1.467 src/proto/character.grpc-server.ts(48,30): error TS7006: Parameter 'bytes' implicitly has an 'any' type. +1.467 src/proto/character.grpc-server.ts(49,29): error TS7006: Parameter 'bytes' implicitly has an 'any' type. +1.467 src/proto/character.grpc-server.ts(50,28): error TS7006: Parameter 'value' implicitly has an 'any' type. +1.467 src/proto/character.grpc-server.ts(50,37): error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +1.467 src/proto/character.grpc-server.ts(51,27): error TS7006: Parameter 'value' implicitly has an 'any' type. +1.467 src/proto/character.grpc-server.ts(51,36): error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +1.485 ERROR: "type-check" exited with 2. +------ +Dockerfile:20 +-------------------- + 18 | + 19 | RUN npm run build_protos + 20 | >>> RUN npm run build + 21 | + 22 | EXPOSE 8080 +-------------------- +ERROR: failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1 + +View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/k2rob0qo9fs8fmawdf7vwutz8 diff --git a/docker-compose.yaml b/docker-compose.yaml index e8ea927..e61ab09 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,7 +2,7 @@ networks: rush-character-net: services: - rush-character-archive: + frontend: build: context: ./ dockerfile: ./frontend/Dockerfile @@ -15,7 +15,7 @@ services: watch: - action: sync path: ./frontend - target: /srv/frontende + target: /srv/frontend ignore: - node_modules - action: rebuild diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 48b1776..541a3b5 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -2,20 +2,21 @@ FROM node:22.16 WORKDIR /srv/proto -COPY proto . -RUN npm install -RUN npm run build +COPY proto/ . +# RUN npm install +# RUN npm run build -WORKDIR /srv/rush-character-archive +WORKDIR /srv/frontend -COPY rush-character-archive/package.json . +COPY frontend/package.json . RUN npm install -RUN npm i -g serve - COPY frontend/. . +RUN npm i -g serve + +RUN npm run build_protos RUN npm run build EXPOSE 8080 diff --git a/frontend/package.json b/frontend/package.json index 8d764d5..5e91d88 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -5,6 +5,7 @@ "type": "module", "scripts": { "dev": "vite", + "build_protos": "mkdir -p src/proto & npx protoc -I=../proto/ --ts_out ./src/proto --proto_path ../proto ../proto/*.proto", "build": "run-p type-check \"build-only {@}\" --", "preview": "vite preview", "build-only": "vite build", diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 4217010..4adf099 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -9,7 +9,17 @@ export default defineConfig({ plugins: [ vue(), vueDevTools(), - ], + ], + preview: { + port: 3000, + strictPort: true, + }, + server: { + port: 3000, + strictPort: true, + host: true, + origin: "http://0.0.0.0:3000", + }, resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) diff --git a/vault/Dockerfile b/vault/Dockerfile index deedeaf..47730d8 100644 --- a/vault/Dockerfile +++ b/vault/Dockerfile @@ -2,7 +2,9 @@ FROM node:22.16 WORKDIR /srv/proto -COPY proto . +COPY proto/ . +# RUN npm install +# RUN npm run build WORKDIR /srv/vault @@ -10,10 +12,7 @@ COPY vault/package.json . RUN npm install -COPY vault . - -RUN npm install -g protoc -RUN npm install -g protoc-gen-ts +COPY vault/ . RUN npm run build_protos RUN npm run build