feat(dev): add Docker development CLI

This commit is contained in:
Thomas Camlong committed 2026-07-31 14:28:31 +02:00
1 parent 61128ddcc8
commit e97eb7fc58
26 files changed
+3277 -11

No files matched your search

@@ -16,7 +16,9 @@ This guide will help you set up your development environment to start contributi
- **Node.js (lts)**: You can download it from the [official website](https://nodejs.org/).
- **pnpm (latest)**: You can install it by running `npm install -g pnpm`.
- **Go (latest)**: You can download it from the [official website](https://go.dev/).
- **Git**: You can download it from the [official website](https://git-scm.com/).
- **GitHub CLI**: You can download it from the [official website](https://cli.github.com/).
- **Docker or Docker Desktop**: You can download it from the [official website](https://www.docker.com/).
- **A GitHub account**: You can create one on the [official website](https://github.com/).
@@ -32,23 +34,22 @@ This guide will help you set up your development environment to start contributi
3. Change directory to the project folder with `cd homarr`.
4. Install the dependencies with `pnpm install`.
4. Set up the project with `pnpm dev:setup`. This installs dependencies, starts Redis, creates and migrates a local SQLite database, and installs the `homarr` developer CLI.
5. Start redis by running `pnpm run docker:dev`. This will run a docker-compose file with a redis service.
5. Start the development server with `pnpm dev` and wait for a message that says `✓ Ready in 10.7s`
6. Copy the `.env.example` file to `.env` and replace `DB_URL` with the full path you want to use for the sqlite database file. For example `DB_URL='C:\\Dev\\homarr\\packages\\db\\db.sqlite'`
7. Run the migrations to create the sqlite db file with `pnpm run db:migration:sqlite:run`.
8. Start the development server with `pnpm dev` and wait for a message that says `✓ Ready in 10.7s`
9. Open your browser and navigate to [http://localhost:3000](http://localhost:3000). (Loading the page might take up to 2 minutes the first time)
6. Open your browser and navigate to [http://localhost:3000](http://localhost:3000). (Loading the page might take up to 2 minutes the first time)
### Useful npm scripts
#### During development
- `pnpm dev`: Start the development server.
- `pnpm dev:setup`: Set up dependencies, services, database, and developer CLI.
- `homarr dev`: Browse and run local images and remote pull-request images.
- `homarr build <name>`: Build the current checkout as `homarr:<name>`.
- `homarr build --pr <number>`: Build a pull request locally from a temporary checkout.
- `homarr rebuild <name>`: Rebuild a local image from its recorded checkout or pull request.
- `pnpm cli`: Run cli commands.
- `pnpm db:migration:sqlite:run`: Run the migrations to create or update the sqlite db file.
- `pnpm db:migration:sqlite:generate`: Generate a new migration file for the sqlite db. Also works with `mysql`.
@@ -63,6 +64,7 @@ This guide will help you set up your development environment to start contributi
- `pnpm typecheck`: Run the typescript type checker.
#### Building the project
- `pnpm build`: Build the project for production.
- `docker build -t homarr .`: Build a docker image for the project.
- `docker run -p 7575:7575 -e SECRET_ENCRYPTION_KEY='your_64_character_hex_string' homarr:latest`: Run the created docker image.
- `homarr build <name>`: Build a `homarr:<name>` image and record its checkout for later rebuilds.
- `docker run -p 7575:7575 -e SECRET_ENCRYPTION_KEY='your_64_character_hex_string' homarr:latest`: Run the created docker image.