Build frontend during docker build #634
                
     Open
            
            
          
  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.
  
    
  
    
Description
I guess this could be viewed as a bug fix. Today it's not possible to build the Dockge container locally and have a working installation as
/app/frontend-distwill be missing from the resulting image.I'm suspect that when Dockge currently is built for distribution to Docker Hub, the frontend is built separately, outside the docker environment, but this requires a nodejs development environment and also is less controlled than building inside the docker environment (like the health check for example).
This PR adds an extra build stage in the main Dockerfile to build the frontend and then copies this into the final image. It also adds the build directive into
compose.yamlso thatdocker compose buildworks.This does not change any of the existing default behaviour. On a fresh system,
docker compose upwill pull from Docker Hub as before, this just supports the option to build the container locally.Steps for a full local build, from a system with just docker installed and the repo cloned:
This fix is particularly useful to forked repos and for local development.
Type of change
Please delete any options that are not relevant.
Checklist
(including JSDoc for methods)
Screenshots (if any)
Output from
docker compose upon a fresh system with these changes: containers-from-dockerhub.txt.Output from the build steps as noted above on a fresh system with these changes: local-docker-build.txt.