π A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!
Vue awesomedashboarddockerhomelabhomepagemitnodejsorganizationproductivitypwaself-hostedstartpagevue
π³ Removes build requirement from Dockerfile
Alicia Sykesabe85efc5f32
diff --git a/.github/workflows/docker-build-publish.yml b/.github/workflows/docker-build-publish.ymlindex 2b3c7684..22757c22 100644--- a/.github/workflows/docker-build-publish.yml+++ b/.github/workflows/docker-build-publish.yml@@ -39,13 +39,10 @@ jobs:type=raw,value=latestflavor: |latest=false- labels: |- maintainer=Lissy93- org.opencontainers.image.title=Dashy- org.opencontainers.image.description=A self-hosted startpage for your server- org.opencontainers.image.documentation=https://dashy.to/docs- org.opencontainers.image.authors=Alicia Sykes- org.opencontainers.image.licenses=MIT++ - name: β±οΈ Capture Build Timestamp+ id: timestamp+ run: echo "iso=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT"- name: π§ Set up QEMUuses: docker/setup-qemu-action@v4@@ -71,12 +68,17 @@ jobs:- name: π¦ Check Registry Statususes: crazy-max/ghaction-docker-status@v4- - name: βοΈ Build and push+ - name: βοΈ Build and Pushuses: docker/build-push-action@v7with:context: .file: ./Dockerfileplatforms: linux/amd64,linux/arm64,linux/arm/v7tags: ${{ steps.meta.outputs.tags }}- labels: ${{ steps.meta.outputs.labels }}+ build-args: |+ VERSION=${{ steps.meta.outputs.version }}+ REVISION=${{ github.sha }}+ CREATED=${{ steps.timestamp.outputs.iso }}+ cache-from: type=gha+ cache-to: type=gha,mode=maxpush: truediff --git a/Dockerfile b/Dockerfileindex 9aa6e557..7c4b8e88 100644--- a/Dockerfile+++ b/Dockerfile@@ -1,51 +1,63 @@-FROM node:20-alpine AS build--# Set the platform to build image for-ARG TARGETPLATFORM-ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}--# Install additional tools needed if on arm64 / armv7-RUN \- case "${TARGETPLATFORM}" in \- 'linux/arm64') apk add --no-cache python3 make g++ ;; \- 'linux/arm/v7') apk add --no-cache python3 make g++ ;; \- esac--# Create and set the working directory-WORKDIR /app--# Install app dependencies-COPY package.json yarn.lock ./-RUN yarn install --ignore-engines --immutable --no-cache --network-timeout 300000 --network-concurrency 1--# Copy over all project files and folders to the working directory-COPY . ./--# Build initial app for production-RUN yarn build--# Production stage-FROM node:20-alpine--# Define some ENV Vars-ENV PORT=8080 \- DIRECTORY=/app \- IS_DOCKER=true--# Create and set the working directory-WORKDIR ${DIRECTORY}--# Update tzdata for setting timezone-RUN apk add --no-cache tzdata--# Copy built application from build phase-COPY --from=build /app ./--# Finally, run start command to serve up the built application-CMD [ "yarn", "build-and-start" ]--# Expose the port-EXPOSE ${PORT}--# Run simple healthchecks every 5 mins, to check that everythings still great-HEALTHCHECK --interval=5m --timeout=5s --start-period=30s CMD yarn health-check+FROM node:24-alpine AS build++WORKDIR /app++COPY package.json yarn.lock ./+RUN yarn install --frozen-lockfile --network-timeout 600000++COPY . .+RUN yarn build++FROM node:24-alpine AS deps++WORKDIR /app++COPY package.json yarn.lock ./+RUN yarn install --production --frozen-lockfile --network-timeout 600000 \+ && yarn cache clean++FROM node:24-alpine++ARG VERSION=dev+ARG REVISION+ARG CREATED++LABEL org.opencontainers.image.title="Dashy" \+ org.opencontainers.image.description="The self-hosted dashboard" \+ org.opencontainers.image.url="https://dashy.to" \+ org.opencontainers.image.documentation="https://dashy.to/docs" \+ org.opencontainers.image.source="https://github.com/lissy93/dashy" \+ org.opencontainers.image.licenses="MIT" \+ org.opencontainers.image.authors="Alicia Sykes <[email protected]>" \+ org.opencontainers.image.vendor="Alicia Sykes" \+ org.opencontainers.image.version="${VERSION}" \+ org.opencontainers.image.revision="${REVISION}" \+ org.opencontainers.image.created="${CREATED}"++ENV NODE_ENV=production \+ IS_DOCKER=true \+ PORT=8080 \+ HOST=0.0.0.0++WORKDIR /app++RUN apk add --no-cache tzdata tini++COPY --chown=node:node --from=deps /app/node_modules ./node_modules+COPY --chown=node:node --from=build /app/dist ./dist+COPY --chown=node:node --from=build /app/public ./public+COPY --chown=node:node --from=build /app/services ./services+COPY --chown=node:node --from=build /app/src/utils/config/ConfigSchema.json ./src/utils/config/ConfigSchema.json+COPY --chown=node:node --from=build /app/server.js ./server.js+COPY --chown=node:node --from=build /app/package.json ./package.json+COPY --chown=node:node --from=build /app/user-data/conf.yml ./user-data/conf.yml++USER node++EXPOSE 8080++HEALTHCHECK --interval=5m --timeout=10s --start-period=20s --retries=3 \+ CMD node services/healthcheck.js++ENTRYPOINT ["/sbin/tini", "--"]+CMD ["node", "server.js"]diff --git a/docker-compose.yml b/docker-compose.ymlindex 9573c666..a10c2abd 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -1,43 +1,41 @@----# Welcome to Dashy! To get started, run `docker compose up -d`-# You can configure your container here, by modifying this file-version: "3.8"services:dashy:container_name: Dashy+ image: lissy93/dashy:latest- # Pull latest image from DockerHub- image: lissy93/dashy-- # To build from source, replace 'image: lissy93/dashy' with 'build: .'- # build: .-- # You can also use an image with a different tag, or pull from a different registry, e.g:+ # Or use a different registry (like GHCR), or a specific tag (like :4.0.0)# image: ghcr.io/lissy93/dashy or image: lissy93/dashy:3.0.0- # Pass in your config file below, by specifying the path on your host machine- # volumes:- # - /path/to/my-config.yml:/app/user-data/conf.yml- # - /path/to/item-icons:/app/user-data/item-icons/+ # Or, to build from source, replace `image:` with `build: .`+ # build: .# Set port that web service will be served on. Keep container port as 8080ports:- 4000:8080- # Set any environmental variables+ # Mount the directory for your conf and assets to `/app/user-data`+ # This dir NEEDS a conf.yml (the main config file for Dashy)+ # This dir can also contain other configs as well as any assets like+ # icons, stylesheets, fonts, etc which will be served from the web root (/)+ # volumes:+ # - ./user-data:/app/user-data++ # Specify environmental variables for the Dashy server, none needed by defaultenvironment:- NODE_ENV=production- # Specify your user ID and group ID. You can find this by running `id -u` and `id -g`- # - UID=1000- # - GID=1000++ # If your host uid is different, and causing perm errs for mounted content+ # Then you can instead use your own ids (`id -u` / `id -g`)+ # user: "1000:1000"# Specify restart policyrestart: unless-stopped# Configure healthcheckshealthcheck:- test: ['CMD', 'node', '/app/services/healthcheck']+ test: ['CMD', 'node', '/app/services/healthcheck.js']interval: 1m30stimeout: 10sretries: 3- start_period: 40s+ start_period: 30sdiff --git a/docs/deployment.md b/docs/deployment.mdindex 0d6c990a..d23fad56 100644--- a/docs/deployment.md+++ b/docs/deployment.md@@ -63,28 +63,29 @@ Dashy has a built container image hosted on [Docker Hub](https://hub.docker.com/```bashdocker run -d \-p 8080:8080 \- -v /root/my-local-conf.yml:/app/user-data/conf.yml \+ -v /path/to/your/user-data:/app/user-data \--name my-dashboard \--restart=always \lissy93/dashy:latest```-Explanation of the above options:+The `user-data` directory you mount must contain a `conf.yml` file. It can also contain any sub-config files, item icons, fonts, custom CSS, or other assets you want served from the web root. Anything you put in there is available at `/<filename>` in the browser.+Explanation of the above options:- `-d` Detached mode (not running in the foreground of your terminal)-- `-p` The port that should be exposed, and the port it should be mapped to in your host system `[host-port][container-port]`, leave the container port as is-- `-v` Specify volumes, to pass data from your host system to the container, in the format of `[host-path]:[container-path]`, you can use this to pass your config file, directory of assets (like icons), custom CSS or web assets (like favicon.ico, manifest.json etc)+- `-p` The port that should be exposed, and the port it should be mapped to in your host system `[host-port]:[container-port]`, leave the container port as `8080`+- `-v` Mounts the host directory containing your `conf.yml` (and any other assets) into the container at `/app/user-data`- `--name` Give your container a human-readable name- `--restart=always` Spin up the container when the daemon starts, or after it has been stopped-- `lissy93/dashy:latest` This last option is the image the container should be built from, you can also use a specific version or architecture type, by replacing `:latest` with one of the [tags](https://hub.docker.com/r/lissy93/dashy/tags)+- `lissy93/dashy:latest` The image to run. Replace `:latest` with a specific version from the [tags](https://hub.docker.com/r/lissy93/dashy/tags) if neededFor all available options, and to learn more, see the [Docker Run Docs](https://docs.docker.com/engine/reference/commandline/run/)Dashy is also available through GHCR: `docker pull ghcr.io/lissy93/dashy:latest`-If you're deploying Dashy on a modern ARM-based board, such as a Raspberry Pi (2+), then you'll need to use one of Dashy's ARM images. Set the base image + tag to either `lissy93/dashy:arm64v8` or `lissy93/dashy:arm32v7`, depending on your system architecture. You can also use the `multi-arch` image, which should work on all system architectures.+The `latest` image is multi-arch, so the same tag works on amd64, arm64, and arm/v7 (Raspberry Pi 2+). Docker selects the right variant for your host automatically.-The image defaults to `:latest`, but you can instead specify a specific version, e.g. `docker pull lissy93/dashy:release-1.5.0`+The image defaults to `:latest`, but you can instead specify a specific version, e.g. `docker pull lissy93/dashy:4.0.0`---@@ -95,38 +96,33 @@ Using Docker Compose can be useful for saving your specific config in files, witThe following is a complete example of a [`docker-compose.yml`](https://github.com/Lissy93/dashy/blob/master/docker-compose.yml) for Dashy. Run it as is, or uncomment the additional options you need.```yaml----services:dashy:- # To build from source, replace 'image: lissy93/dashy' with 'build: .'- # build: .- image: lissy93/dashy- container_name: Dashy- # Pass in your config file below, by specifying the path on your host machine- # volumes:- # - /root/my-config.yml:/app/user-data/conf.yml+ # The image to pull + version. Can use `ghcr.io/lissy93/dashy` instead+ image: lissy93/dashy:latest+ # Optional container name+ container_name: dashy+ # Port to serve on (keep container port (second one) as 8080)ports:- 8080:8080- # Set any environmental variables+ # Mount a directory containing your conf.yml and any other assets+ volumes:+ - ./user-data:/app/user-data+ # Add any env vars for server here, if neededenvironment:- NODE_ENV=production- # Specify your user ID and group ID. You can find this by running `id -u` and `id -g`- # - UID=1000- # - GID=1000- # Specify restart policy+ # Auto-start the container on bootrestart: unless-stopped- # Configure healthchecks+ # Healthcheck to determine when container healthyhealthcheck:- test: ['CMD', 'node', '/app/services/healthcheck']+ test: ['CMD', 'node', '/app/services/healthcheck.js']interval: 1m30stimeout: 10sretries: 3- start_period: 40s+ start_period: 30s```-You can use a different tag, by for example setting `image: lissy93/dashy:arm64v8`, or pull from GHCR instead by setting `image: ghcr.io/lissy93/dashy`.--If you are building from source, and would like to use one of the [other Dockerfiles](https://github.com/Lissy93/dashy/tree/master/docker), then under `services.dashy` first set `context: .`, then specify the the path to the dockerfile, e.g. `dockerfile: ./docker/Dockerfile-arm32v7`+To pull from GHCR instead of Docker Hub, set `image: ghcr.io/lissy93/dashy:latest`.---@@ -137,7 +133,7 @@ If you are building from source, and would like to use one of the [other Dockerf```bashpodman run -d \-p 8080:8080 \- -v /path/to/my-conf.yml:/app/user-data/conf.yml:Z \+ -v /path/to/your/user-data:/app/user-data:Z \--name dashy \--restart=always \docker.io/lissy93/dashy:latest@@ -172,7 +168,7 @@ Alternatively, go to Containers > Add container and use the image `lissy93/dashyDashy is available through the [Community Applications](https://forums.unraid.net/topic/38582-plug-in-community-applications/) plugin. Search for "Dashy" in the Apps tab and install from there. The template pre-fills the Docker image, port mapping, and volume paths for you.-If you'd prefer to set it up manually, go to Docker > Add Container and use `lissy93/dashy:latest` as the repository. Map port `8080` and add a path mapping for your config file to `/app/user-data/conf.yml`.+If you'd prefer to set it up manually, go to Docker > Add Container and use `lissy93/dashy:latest` as the repository. Map port `8080`, and add a path mapping for the host directory containing your `conf.yml` to `/app/user-data`.---@@ -208,12 +204,14 @@ Installing dashy is really simply and fast:```bashdocker run -d \-p 4000:8080 \- -v /volume1/docker/dashy/my-local-conf.yml:/app/user-data/conf.yml \+ -v /volume1/docker/dashy:/app/user-data \--name dashy \--restart=always \lissy93/dashy:latest```+(Place your `conf.yml` and any sub-configs / icons / assets inside `/volume1/docker/dashy` on the host.)+dashy should be up within 1-2min after you've started the install task procedure---@@ -299,7 +297,7 @@ The initial build causes a spike in resource usage, but once running it's fairly### Bare Metal-Requires [Node.js](https://nodejs.org/) (v17 recommended) and [Yarn](https://yarnpkg.com/). The `engines` field in `package.json` specifies `>=16.0.0`, but the Docker image uses Node 20 and that's the best-tested version. Builds require the `--openssl-legacy-provider` flag, which the npm scripts already set.+Requires [Node.js](https://nodejs.org/) and [Yarn](https://yarnpkg.com/). The `engines` field in `package.json` specifies `>=18.0.0`, but the Docker image is built and tested on Node 24, so that's the recommended version for bare-metal too.Minimum 512MB memory, 2GB disk space.diff --git a/docs/developing.md b/docs/developing.mdindex 2e6e9a6a..97185560 100644--- a/docs/developing.md+++ b/docs/developing.md@@ -40,8 +40,8 @@ Dashy should now be being served on <http://localhost:8080/>. Hot reload is enab#### Basics-- **`yarn build`** - In the interest of speed, the application is pre-compiled, this means that the config file is read during build-time, and therefore the app needs to rebuilt for any new changes to take effect. Luckily this is very straight forward. Just run `yarn build` or `docker exec -it [container-id] yarn build`-- **`yarn start`** - Starts a web server, and serves up the production site from `./dist` (must run build command first)+- **`yarn build`** - Builds the production bundle into `./dist`. The Vite dev/runtime server serves `user-data/conf.yml` on each request, so a rebuild is only needed when source code or assets change, not when config changes+- **`yarn start`** - Starts the Node server, which serves the built site from `./dist` and the live config from `user-data/`. Run `yarn build` first#### Development@@ -56,15 +56,13 @@ Dashy should now be being served on <http://localhost:8080/>. Hot reload is enab#### Alternate Start Commands-- **`yarn build-and-start`** - Builds the app, runs checks and starts the production server. Commands are run in parallel, and so is faster than running them in independently. Uses the `yarn build` and `yarn start` commands-- **`yarn build-watch`** - If you find yourself making frequent changes to your configuration, and do not want to have to keep manually rebuilding, then this option is for you. It will watch for changes to any files within the projects root, and then trigger a rebuild. Note that if you are developing new features, then `yarn dev` would be more appropriate, as it's significantly faster at recompiling (under 1 second), and has hot reloading, linting and testing integrated+- **`yarn build && yarn start`** - Builds the app, then starts the production Node server. Use this for a manual production-style run on bare metal. With Vite, `conf.yml` is served from `user-data/` at runtime, so config changes only require a page refresh- **`yarn pm2-start`** - Starts the Node server using [PM2](https://pm2.keymetrics.io/), a process manager for Node.js applications, that helps them stay alive. PM2 has some built-in basic monitoring features, and an optional [management solution](https://pm2.io/). If you are running the app on bare metal, it is recommended to use this start command#### Notes- If you are using NPM, replace `yarn` with `npm run`- If you are using Docker, precede each command with `docker exec -it [container-id]`. Container ID can be found by running `docker ps`-- You can manage the app using the [Vue-CLI Service](https://cli.vuejs.org/guide/cli-service.html), with `npx vue-cli-service [command]`. Or to start the Vue Management UI, run `npx vue ui`, and open `http://localhost:8000`### Environmental Variablesdiff --git a/docs/management.md b/docs/management.mdindex b63f9b13..2ebdb07c 100644--- a/docs/management.md+++ b/docs/management.md@@ -5,6 +5,7 @@ _The following article is a primer on managing self-hosted apps. It covers every## Contents- [Providing Assets](#providing-assets)+- [File Ownership and Permissions](#file-ownership-and-permissions)- [Running Commands](#running-commands)- [Healthchecks](#healthchecks)- [Logs and Performance](#logs-and-performance)@@ -29,16 +30,51 @@ _The following article is a primer on managing self-hosted apps. It covers every## Providing Assets-Although not essential, you will most likely want to provide several assets to your running app.+Dashy reads everything for your dashboard from a single host directory mounted into the container at `/app/user-data`. This is done with a [Docker volume](https://docs.docker.com/storage/volumes/), e.g. `-v /path/to/your/user-data:/app/user-data`.-This is easy to do using [Docker Volumes](https://docs.docker.com/storage/volumes/), which lets you share a file or directory between your host system, and the container. Volumes are specified in the Docker run command, or Docker compose file, using the `--volume` or `-v` flags. The value of which consists of the path to the file / directory on your host system, followed by the destination path within the container. Fields are separated by a colon (`:`), and must be in the correct order. For example: `-v ~/alicia/my-local-conf.yml:/app/user-data/conf.yml`+The directory must contain a `conf.yml`. It can also contain anything else you want served from the web root: sub-config files for additional pages, item icons, favicon, fonts, custom CSS, manifest, and so on. Any file placed there is reachable at `/<filename>` in the browser, overriding files of the same name in the bundled `public/` defaults.-In Dashy, commonly configured resources include:+Typical contents:-- `./user-data/conf.yml` - Your main application config file-- `./public/item-icons` - A directory containing your own icons. This allows for offline access, and better performance than fetching from a CDN-- Also within `./public` you'll find standard website assets, including `favicon.ico`, `manifest.json`, `robots.txt`, etc. There's no need to pass these in, but you can do so if you wish-- `/src/styles/user-defined-themes.scss` - A stylesheet for applying custom CSS to your app. You can also write your own themes here.+- `conf.yml` - Main config (required)+- `*.yml` / `*.yaml` - Sub-config files for [multi-page support](/docs/pages-and-sections.md#multi-page-support)+- `item-icons/` - Local icons referenced by `icon: ./item-icons/foo.png`+- `favicon.ico`, `manifest.json`, `robots.txt` - Override the bundled defaults+- `fonts/`, `widget-resources/` - Custom fonts or assets used by widgets++**[β¬οΈ Back to Top](#management)**++---++## File Ownership and Permissions++Inside the container, Dashy runs as a non-root user with uid/gid 1000 (the built-in `node` user from the Node base image). This is fine for the vast majority of installs, since the first user on a default Linux or macOS box is also uid 1000, so a bind-mounted `user-data` directory is read/writable straight away.++It only gets fiddly if your host uid happens to be something else (NAS systems and multi-user servers being the usual culprits). In that case, config saves from the UI will fail with a permission error, because the container's uid 1000 doesn't own your directory.++There are two ways to sort it. Pick whichever is less hassle:++1. **Run the container as your own user.** The cleanest option, since you don't touch host file ownership.++ On `docker run`:+ ```bash+ docker run -d -p 8080:8080 \+ --user $(id -u):$(id -g) \+ -v /path/to/user-data:/app/user-data \+ lissy93/dashy:latest+ ```++ In compose, uncomment the `user:` line under the service and set it:+ ```yaml+ user: "1001:1001" # whatever `id -u` and `id -g` give you+ ```++2. **Hand the directory to uid 1000.** Quicker if you don't mind changing host ownership:+ ```bash+ sudo chown -R 1000:1000 /path/to/user-data+ ```++Note that if you run the container as root (e.g. `--user 0:0`), Dashy will still work, but you lose the security benefit of a non-root container. Don't do that unless you've a good reason.**[β¬οΈ Back to Top](#management)**@@ -287,24 +323,23 @@ You can use Dashy's default [`docker-compose.yml`](https://github.com/Lissy93/daAn example Docker compose, using the default base image from DockerHub, might look something like this:```yaml----services:dashy:container_name: Dashy- image: lissy93/dashy+ image: lissy93/dashy:latestvolumes:- - /root/my-config.yml:/app/user-data/conf.yml+ - ./user-data:/app/user-dataports:- 4000:8080environment:- BASE_URL=/my-dashboardrestart: unless-stoppedhealthcheck:- test: ['CMD', 'node', '/app/services/healthcheck']+ test: ['CMD', 'node', '/app/services/healthcheck.js']interval: 1m30stimeout: 10sretries: 3- start_period: 40s+ start_period: 30s```**[β¬οΈ Back to Top](#management)**@@ -711,18 +746,16 @@ Similarly, never expose `/var/run/docker.sock` to other containers as a volume,### Use Read-Only Volumes-You can specify that a specific volume should be read-only by appending `:ro` to the `-v` switch. For example, while running Dashy, if we want our config to be writable, but keep all other assets protected, we would do:+You can specify that a volume should be read-only by appending `:ro` to the `-v` switch. If you don't need the in-app config editor, mount your `user-data` read-only:```bashdocker run -d \-p 8080:8080 \- -v ~/dashy-conf.yml:/app/user-data/conf.yml \- -v ~/dashy-icons:/app/public/item-icons:ro \- -v ~/dashy-theme.scss:/app/src/styles/user-defined-themes.scss:ro \+ -v ~/dashy-data:/app/user-data:ro \lissy93/dashy:latest```-You can also prevent a container from writing any changes to volumes on your host's disk, using the `--read-only` flag. Although, for Dashy, you will not be able to write config changes to disk, when edited through the UI with this method. You could make this work, by specifying the config directory as a temp write location, with `--tmpfs /app/user-data/conf.yml` - but that this will not write the volume back to your host.+If you do want config changes from the UI to persist back to disk, leave the mount writable. You can also use `--read-only` to make the whole container filesystem read-only, but in that case UI-driven config edits will not be saved.### Set the Logging Leveldiff --git a/docs/quick-start.md b/docs/quick-start.mdindex 1176b9c8..cb2e04a7 100644--- a/docs/quick-start.md+++ b/docs/quick-start.md@@ -20,21 +20,30 @@ To pull the latest image, and build and start the app run:```bashdocker run -d \-p 8080:8080 \- -v ~/my-conf.yml:/app/user-data/conf.yml \- --name my-dashboard \+ -v ~/dashy-data:/app/user-data \+ --name dashy \--restart=always \lissy93/dashy:latest```-Either replace the -v path to point to your config file, or leave it out. For a full list of available options, then see [Dashy with Docker](https://github.com/Lissy93/dashy/blob/master/docs/deployment.md#deploy-with-docker) Docs. If you'd prefer to use Docker Compose, then see [Dashy with Docker Compose](https://github.com/Lissy93/dashy/blob/master/docs/deployment.md#using-docker-compose) Docs. Alternate registries, architectures and pinned versions are also supported.+Your dashboard should now be up and running at `http://localhost:8080` (or your servers IP address/ domain, and the port that you chose) π-Your dashboard should now be up and running at `http://localhost:8080` (or your servers IP address/ domain, and the port that you chose). The first time you build, it may take a few minutes.+Dashy is also available via GHCR (`ghcr.io/lissy93/dashy`).<br>+You can either use `:latest` or pin to specific versions (like `4.0.0`).<br>+All images are multi-arch (works on amd64, arm64, and arm/v7).<br>+To use with compose, see our sample [`docker-compose.yml`](https://github.com/lissy93/dashy/blob/master/docker-compose.yml).<br>+Once up and running, check the [configuring reference](https://dashy.to/docs/configuring) and [other docs](https://dashy.to/docs).<br>++> [!NOTE]+> You need to mount a directory for your Dashy settings in `/app/user-data`.+> The only required file here is the `conf.yml`, but this is also where you can put any other page configs and assets like images/icons, stylesheets, fonts, etc.+> Everything in this directory is served from Dashy's root (e.g. `/app/user-data/logo.png` will be accessible at `http://[dashy.local]/logo.png`).---## 3. User Data Directory-Your config file should be placed inside `user-data/` (in Docker, that's `/app/user-data/`).+Your config file should be placed inside `user-data` (in Docker, that's `/app/user-data/`).This directory can also contain some optional assets you wish to use within your dashboard, like icons, fonts, styles, scripts, etc.@@ -97,8 +106,8 @@ sections: # An array of sectionsNotes:-- You can use a Docker volume to pass a config file from your host system to the container- - E.g. `-v ./host-system/my-local-conf.yml:/app/user-data/conf.yml`+- You can use a Docker volume to pass your `user-data` directory from the host into the container+ - E.g. `-v ./host-system/user-data:/app/user-data`- It's also possible to edit your config directly through the UI, and changes will be saved in this file- Check your config against Dashy's schema, with `docker exec -it [container-id] yarn validate-config`- You might find it helpful to look at some examples, a collection of which can be [found here](https://gist.github.com/Lissy93/000f712a5ce98f212817d20bc16bab10)diff --git a/docs/troubleshooting.md b/docs/troubleshooting.mdindex 4e58733e..44e0141f 100644--- a/docs/troubleshooting.md+++ b/docs/troubleshooting.md@@ -17,7 +17,9 @@- [Sub-page shows "Unable to find config for ..."](#sub-page-shows-unable-to-find-config-for-)- [Sub-page missing from nav, or won't open when clicked](#sub-page-missing-from-nav-or-wont-open-when-clicked)- [Sub-page ignores its theme, layout or appConfig](#sub-page-ignores-its-theme-layout-or-appconfig)+- [Sub-config files return 404](#sub-config-files-return-404)- [Yarn Build or Run Error](#yarn-error)+- [`yarn build` fails inside the container](#yarn-build-fails-inside-the-container)- [Remote Config Not Loading](#remote-config-not-loading)- [High CPU or RAM Usage on Startup](#high-cpu-or-ram-usage-on-startup)- [Heap limit Allocation failed](#ineffective-mark-compacts-near-heap-limit-allocation-failed)@@ -27,12 +29,14 @@- [App Not Starting After Update to 2.0.4](#app-not-starting-after-update-to-204)- [Keycloak Redirect Error](#keycloak-redirect-error)- [OIDC or Keycloak failure on numeric client IDs](#oidc-or-keycloak-failure-on-numeric-client-ids)-- [Docker Directory Error](#docker-directory)+- [Mount Type Mismatch](#mount-type-mismatch)+- [Permission Denied Saving Config](#permission-denied-saving-config)- [Config not Saving on Vercel / Netlify / CDN](#config-not-saving-on-vercel--netlify--cdn)- [Config Not Updating](#config-not-updating)- [Config Still not Updating](#config-still-not-updating)- [Styles and Assets not Updating](#styles-and-assets-not-updating)- [DockerHub toomanyrequests](#dockerhub-toomanyrequests)+- [Old image tags fail to pull](#old-image-tags-fail-to-pull)- [Config Validation Errors](#config-validation-errors)- [Node Sass unsupported environment](#node-sass-does-not-yet-support-your-current-environment)- [Unreachable Code Error](#unreachable-code-error)@@ -51,7 +55,6 @@- [Widget Displaying Inaccurate Data](#widget-displaying-inaccurate-data)- [Font Awesome Icons not Displaying](#font-awesome-icons-not-displaying)- [Copy to Clipboard not Working](#copy-to-clipboard-not-working)-- [Unsupported Digital Envelope Routines](#unsupported-digital-envelope-routines)- [How to Reset Local Settings](#how-to-reset-local-settings)- [How to make a bug report](#how-to-make-a-bug-report)- [Public IP Widget not working for ipinfo or ipquery providers](#public-ip-widget-not-working-for-ipinfo-or-ipquery-providers)@@ -224,6 +227,30 @@ If you put `appConfig` inside a sub-page YAML, it's silently dropped on load. Mo---+## Sub-config files return 404++If your `conf.yml` references additional pages via `pages:` and the browser shows `Sub-config load failed: /something.yml`, the cause is almost always a Docker mount that only exposes `conf.yml` and not the rest of `user-data/`.++If you've done this:++```yaml+volumes:+ - ./my-conf.yml:/app/user-data/conf.yml+```++Only `conf.yml` exists inside the container. Anything it references (sub-configs, custom icons, fonts, CSS) isn't there.++Mount the directory instead:++```yaml+volumes:+ - ./user-data:/app/user-data+```++Now everything in your `user-data` folder is reachable at the web root. Same applies to `docker run -v`.++---+## Yarn ErrorFor more info, see [Issue #1](https://github.com/Lissy93/dashy/issues/1)@@ -244,6 +271,16 @@ Alternatively, as a workaround, you have several options:---+## `yarn build` fails inside the container++If you run `docker exec <container> yarn build` and get `vite: not found` (or similar), it's because the published image ships only production dependencies. The build toolchain (vite, vue-tsc, sass, etc.) lives in `devDependencies` and isn't installed in the runtime image.++You almost certainly don't need to rebuild. Dashy's Express server reads `user-data/conf.yml` on every request, so config changes show up on a page refresh, no rebuild required.++If you genuinely need a fresh build (you've patched something in `src/`), do it on the host with `yarn install && yarn build`, or build a custom image from a checkout of the repo.++---+## Remote Config Not LoadingIf you've got a multi-page dashboard, and are hosting the additional config files yourself, then CORS rules will apply. A CORS error will look something like:@@ -429,18 +466,37 @@ See also: #1941----## Docker Directory+## Mount Type Mismatch```text-Error response from daemon: OCI runtime create failed: container_linux.go:380:-starting container process caused: process_linux.go:545: container init caused:-rootfs_linux.go:76: mounting "/home/ubuntu/my-conf.yml" to rootfs at-"/app/user-data/conf.yml" caused: mount through procfd: not a directory:-unknown: Are you trying to mount a directory onto a file (or vice-versa)?-Check if the specified host path exists and is the expected type.+Error response from daemon: ... mount through procfd: not a directory:+Are you trying to mount a directory onto a file (or vice-versa)?+```++This means the host side and container side of your volume don't agree on whether the target is a file or a directory.++Recommended pattern: mount a host directory onto `/app/user-data`. The directory must exist on the host and contain at least a `conf.yml`:++```bash+mkdir -p ~/dashy-data+cp /path/to/your/conf.yml ~/dashy-data/conf.yml+docker run -d -p 8080:8080 -v ~/dashy-data:/app/user-data lissy93/dashy:latest```-If you get an error similar to the one above, you are mounting a directory to the config file's location, when a plain file is expected. Create a YAML file, (`touch my-conf.yml`), populate it with a sample config, then pass it as a volume: `-v ./my-local-conf.yml:/app/user-data/conf.yml`+If you'd rather mount a single file (`-v ~/conf.yml:/app/user-data/conf.yml`), the host path must be a file that already exists, otherwise Docker creates a directory in its place and you'll see this error.++---++## Permission Denied Saving Config++If saving config from the UI fails with `EACCES` or `permission denied`, your mounted `user-data` directory is owned by a uid the container can't write to. Inside the container, Dashy runs as uid 1000 (the `node` user), and your host directory probably belongs to a different uid.++Two fixes, pick whichever's less of a faff:++1. Run the container as your own user. On `docker run`, add `--user $(id -u):$(id -g)`. In `docker-compose.yml`, uncomment the `user:` line and set it to your uid:gid (run `id -u` and `id -g` to find them).+2. Hand the directory to uid 1000: `sudo chown -R 1000:1000 /path/to/your/user-data`.++Most people are already uid 1000 on Linux and macOS, so this only tends to bite on NAS boxes, multi-user servers, or anywhere the first user isn't 1000.---@@ -504,6 +560,20 @@ You can [check your rate limit status](https://www.docker.com/blog/checking-your---+## Old image tags fail to pull++If `docker pull` returns `manifest unknown` or `manifest for lissy93/dashy:arm32v7 not found`, the cause is a stale architecture-specific tag in your compose file or run command. Tags like `:arm32v7`, `:arm64v8`, and `:multi-arch` are no longer published.++The `:latest` tag is now multi-arch and works on amd64, arm64, and arm/v7 (Raspberry Pi 2 and up) without you having to pick a variant. Just use:++```yaml+image: lissy93/dashy:latest+```++Docker fetches the right architecture for your host automatically. To pin a version, use a semver tag, e.g. `lissy93/dashy:3.2.14`.++---+## Config Validation ErrorsThe configuration file is validated against [Dashy's Schema](https://github.com/Lissy93/dashy/blob/master/src/utils/config/ConfigSchema.json) using AJV.@@ -591,7 +661,7 @@ If you're serving Dashy though a CDN, instead of using the Node server or Docker## Healthcheck Failing in Docker-If `docker ps` shows the Dashy container as `unhealthy`, it means the periodic healthcheck (`yarn health-check`, run every 5 minutes by default) couldn't reach the local server.+If `docker ps` shows the Dashy container as `unhealthy`, the periodic healthcheck (`node services/healthcheck.js`, run every 5 minutes by default) couldn't reach the local server.### SSL-enabled Dashy@@ -601,9 +671,9 @@ The healthcheck reads the same cert paths as the main server (`/etc/ssl/certs/daIf you've set `PORT` to override the default 8080, the healthcheck honors the same env var, so it should work without changes. Make sure `PORT` is set in the container environment, not just in the host-side Docker port mapping.-### Slow startup on weak hardware+### Container is unhealthy past the grace period-The healthcheck has a `--start-period=30s` grace period before failures count against the container. If your host takes longer than 30 seconds for the initial Vue build to complete (common on Pi 3 or similar), the first few healthchecks will fail and you may briefly see `unhealthy`. After the build finishes, subsequent checks should pass - see [High CPU or RAM Usage on Startup](#high-cpu-or-ram-usage-on-startup) below.+The healthcheck has a 20s `start-period` after which failures start counting. The image is prebuilt, so startup is just `node server.js` binding to a port - fast even on a Pi. If the container is still `unhealthy` past the grace period, the server has likely crashed. Check `docker logs <container>` for the real error (usually a malformed `conf.yml` or a missing `user-data` mount).See also: [#1410](https://github.com/Lissy93/dashy/issues/1410)@@ -767,21 +837,6 @@ As a workaround, you could either:----## Unsupported Digital Envelope Routines--If you're running on GitHub Codespaces, and seeing: `Error: error:0308010C:digital envelope routines::unsupported` when using Node 17+, it can be resolved by adding the `--openssl-legacy-provider` flag to your `NODE_OPTIONS` environmental variable.-For example:--```-export NODE_OPTIONS=--openssl-legacy-provider-```--This will be fixed once [webpack/webpack#17659](https://github.com/webpack/webpack/pull/17659) is merged.--**Update:** This should be fully resolved. Raise a ticket if you're still needing to use those NODE_OPTIONS after upgrade.------## How to Reset Local SettingsSome settings are stored locally, in the browser's storage.