fix(docker): ensure optimized maps are generated in frontend build (closes #19) - #370
Open
dev-vishalmaurya wants to merge 1 commit into
Open
fix(docker): ensure optimized maps are generated in frontend build (closes #19)#370dev-vishalmaurya wants to merge 1 commit into
dev-vishalmaurya wants to merge 1 commit into
Conversation
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Descripción del problema
En un clon limpio,
frontend/public/maps_optimized/no existe porque está ignorado en.gitignore. Elfrontend/Dockerfilerealizabapnpm buildcopiando únicamentefrontendypackages/protocol, por lo que la imagen resultante no contenía los 294 mapas optimizados del juego. Al iniciar el contenedor y acceder desde el navegador, el cliente recibía errores 404 (ej./maps_optimized/mapa_1.json) y el terreno del mundo no se dibujaba.Solución implementada
frontend/scripts/ensure-maps.mjs):server/mapas_source/y los genera automáticamente enpublic/maps_optimized/(~2 s).cd server && pnpm export-frontend-maps.frontend/package.json):predevyprebuild(pnpm run protocol:build && node scripts/ensure-maps.mjs).pnpm run maps:ensureypnpm run maps:export.frontend/Dockerfile):server/mapas_sourceen la etapabuild(COPY server/mapas_source /app/server/mapas_source), de modo quepnpm buildgenera los 294 mapas antes de que la etapa finalruntimecopiepublic/. La carpeta de origen no se incluye en el runtime, manteniendo la imagen ligera.README.md):Criterios de aceptación verificados
Closes #19