Skip to content

Conversation

Jamie-
Copy link

@Jamie- Jamie- commented Oct 12, 2024

  • I have read and understand the pull request rules.

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-dist will 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.yaml so that docker compose build works.

This does not change any of the existing default behaviour. On a fresh system, docker compose up will 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:

docker build -t louislam/dockge:build-healthcheck -f docker/BuildHealthCheck.Dockerfile .
docker build -t louislam/dockge:base -f docker/Base.Dockerfile .
docker compose build

This fix is particularly useful to forked repos and for local development.

Type of change

Please delete any options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Other

Checklist

  • My code follows the style guidelines of this project
  • I ran ESLint and other linters for modified files
  • I have performed a self-review of my own code and tested it
  • I have commented my code, particularly in hard-to-understand areas
    (including JSDoc for methods)
  • My changes generate no new warnings
  • My code needed automated testing. I have added them (this is optional task)

Screenshots (if any)

Output from docker compose up on 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.

Dracrius added a commit to Dracrius/dockge that referenced this pull request Jun 2, 2025
Merge @Jamie-'s pull request that builds the dockge frontend during the docker build.
Dracrius added a commit to Dracrius/dockge that referenced this pull request Jun 2, 2025
Merge @Jamie-'s pull request that builds the frontend during docker build.
Dracrius added a commit to Dracrius/dockge that referenced this pull request Jun 3, 2025
Merged @Jamie-'s pull request that builds the frontend during docker build.
@Dracrius
Copy link

Dracrius commented Jun 3, 2025

This should be switched to npm instead of pnpm. It was failing to build with this pull request alone. I noticed other forks that didn't even bother pulling this made note of using npm instead to be consistent with the rest of the build but it also solves the issues introduced by pnpm not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants