dashy icon indicating copy to clipboard operation
dashy copied to clipboard

[BUG] Docker rebuilds the app every time the container is restarted

Open GGORG0 opened this issue 2 years ago • 5 comments

Environment

Self-Hosted (Docker)

System

Raspberry Pi OS Bullseye; Docker-ce 20.10.17

Version

2.1.1

Describe the problem

Every time I start the docker container, the app rebuilds itself. I'm unable to access the interface, because my host (Raspberry Pi 4 2GB) is not powerful enough and the system crashes every time. Docker containers should build the app at image build time (in the Dockerfile, before it is published to the registry) or at least cache the build. That makes container startup instant every single time. I'm suprised no one reported this before.

Additional info

image (I normally run with compose, but here i ran it in interactive mode to show the output)

Please tick the boxes

GGORG0 avatar Aug 30 '22 09:08 GGORG0

If you're enjoying Dashy, consider dropping us a ⭐
🤖 I'm a bot, and this message was automated

liss-bot avatar Aug 30 '22 09:08 liss-bot

#799 is becoming very popular :)

chevdor avatar Aug 30 '22 10:08 chevdor

Also, the subtitle needs to be changed, because it's kinda funny how it says "Your new dashboard is now up and running" before it acually rebuilds the app, which can take a long time depending on the host.

GGORG0 avatar Aug 30 '22 10:08 GGORG0

Hello, I love the app thanks a lot @Lissy93 for sharing it <3

I found this problem too but for me was related with the amount resources that the container was using in the current release (about ~500Mb RAM), that for a dashboard is quite a bit, actually is the most RAM hungry container in my lab.

After checking the Dockerfile I noticed that the final run-time command for the container is yarn build-and-start with is a parallel run of node server and vue-cli-service build --watch --mode production. This parameter will make the build process keep watching the folder waiting to rebuild the app on any change. I guess this is related with 2 needs, developing or the app itself need to rebuild to show some changes.

I just created a PR with a Dockerfile that just init the container with yarn start, using effectively only 60 Mb of RAM, with no rebuilds. I restored my dashboard with ID and then created new items and everything seems to be working as it should.

sur1v avatar Sep 07 '22 15:09 sur1v

PR has been merged so should be solved next release, meanwhile you can build your own image from Dockerfile at master

sur1v avatar Sep 11 '22 18:09 sur1v

This issue has gone 6 weeks without an update. To keep the ticket open, please indicate that it is still relevant in a comment below. Otherwise it will be closed in 5 working days.

liss-bot avatar Oct 13 '22 01:10 liss-bot

I was wondering the same thing, I experimented for a while with doing just yarn start instead of yarn build-and-start and while the app works, but a lot of features are broke, like multi page support and hash url routing, took me months to figure out this issue, at some point I even started looking for other dashboards because I started to feel the code was broken and there's not enough support on this one. I created a question about this a week ago here https://github.com/Lissy93/dashy/issues/932 but since this is here I'm gonna link them together and close my issue.

coalwater avatar Oct 13 '22 09:10 coalwater

This issue has gone 6 weeks without an update. To keep the ticket open, please indicate that it is still relevant in a comment below. Otherwise it will be closed in 5 working days.

liss-bot avatar Nov 14 '22 01:11 liss-bot

This issue was automatically closed because it has been stalled for over 6 weeks with no activity.

liss-bot avatar Nov 19 '22 01:11 liss-bot

t some point I even started looking for other dashboards because I started to feel the code was broken and there's not enough support on this one. I created a question about this a we

Using yarn start instead of yarn build-and-start takes more ressources but essetinally yarn start does not rebuild on changes so it created a lot of problems and unhappy users.

Reverted this.

CrazyWolf13 avatar Mar 03 '24 17:03 CrazyWolf13

I was wondering the same thing, I experimented for a while with doing just yarn start instead of yarn build-and-start and while the app works, but a lot of features are broke, like multi page support and hash url routing, took me months to figure out this issue, at some point I even started looking for other dashboards because I started to feel the code was broken and there's not enough support on this one. I created a question about this a week ago here #932 but since this is here I'm gonna link them together and close my issue.

Hi, yes you are right! This problems seems to be related to dashy not automatically rebuilding on changes, see #1479 and https://github.com/Lissy93/dashy/issues/1290#issuecomment-1884249018 A new release has just been published, which should fix this issue, so please upgrade to the latest version. If this is not the case just respond back to this ticket and I'll reopen this issue. Thanks and have a nice day.

CrazyWolf13 avatar Mar 03 '24 17:03 CrazyWolf13

@GGORG0 FYI in the next major version an overhaul to dashy, we will remove the need to rebuild the application for every change, then the docker container does not have to rebuild on every start.

If it really bothers you I recommand changing the start command in the container settings to yarn start instead of yarn build-and-start, this can be done the easiest with portainer(web gui to docker) then edit the container and redeploy

CrazyWolf13 avatar Mar 03 '24 17:03 CrazyWolf13

I think was caught up this is issue. My main instance of Dashy died, and I was trying to spin up a backup to get me by until I could get my main instance back up. I don't think that I need support, I'm just putting this out there in case it helps someone else with trouble getting Dashy to run.

New Docker versions: Docker version 26.0.0, build 2ae903e New Docker Compose V2 version: Docker Compose version v2.25.0 Dashy is updated Using Dashy V-2.1.2. Update Check Complete

Each time it started the Config File check passed.

Dashy  | Checking config file against schema...
Dashy  | ✔️ Config file is valid, no issues found

I'm trying to get it it running again, using the suggestions from the various threads, such as GUI Build, yarn start etc. I have two servers running, and I can't get Dashy to load on either. Fails the same way on each server.

Documentation suggests that I need to map a volume for the conf.yml and I have my formerly working instance loaded from a export, but it put a folder where a file needed to be, so I modified it from /root/my-local-conf.yml:/app/public/conf.yml to /root/folder/path/:/app/public/

I confirmed read/write access from inside the containers and outside the containers.

Restore from Cloudbackup worked - temporarily.. but restarting the container wasn't persistent, and even reloading the webpage wouldn't save the config. I tried save locally, it did not help make the config anymore persistent.

Last thing I did was check the formatting of the conf.yml

The one I was having trouble with was formatted like this (JSON?):

{
  "appConfig": {
    "theme": "nord-frost",
    "layout": "horizontal",
    "iconSize": "large",
    "language": "en"
  },
  "pageInfo": {
    "title": "Dashy for Breeegz",
    "description": "Dashboard V0.8",
    "navLinks": [
      {
        "title": "GitHub",
        "path": "https://github.com/Lissy93/dashy",
        "target": "newtab"
      },

and if I changed it to this style which I harvested from the cloud backup (Step 1: restore backup, Step 2:download file)

appConfig:
  theme: nord-frost
  layout: horizontal
  iconSize: large
  language: en
pageInfo:
  title: Dashy for Breeegz
  description: Dashboard V0.8
  navLinks:
    - title: GitHub
      path: https://github.com/Lissy93/dashy
      target: newtab
    - title: Documentation
      path: https://dashy.to/docs
      target: newtab
  footerText: ''
sections:
  - name: Getting Started
    icon: ''
    items:
      - &ref_0
        title: Dashy Live
        description: Development a project management links for Dashy
        icon: https://i.ibb.co/qWWpD0v/astro-dab-128.png
        url: https://live.dashy.to/
        target: newtab
        id: 0_1481_dashylive
      - &ref_1
        title: GitHub
        description: Source Code, Issues and Pull Requests
        url: https://github.com/lissy93/dashy
        icon: favicon
        id: 1_1481_github
      - &ref_2
        title: Docs
        description: Configuring & Usage Documentation
        provider: Dashy.to
        icon: far fa-book
        url: https://dashy.to/docs
        id: 2_1481_docs
      - &ref_3
        title: Showcase
        description: See how others are using Dashy
        url: https://github.com/Lissy93/dashy/blob/master/docs/showcase.md
        icon: far fa-grin-hearts
        id: 3_1481_showcase
      - &ref_4
        title: Config Guide
        description: See full list of configuration options
        url: https://github.com/Lissy93/dashy/blob/master/docs/configuring.md
        icon: fas fa-wrench
        id: 4_1481_configguide
      - &ref_5
        title: Support
        description: Get help with Dashy, raise a bug, or get in contact
        url: https://github.com/Lissy93/dashy/blob/master/.github/SUPPORT.md
        icon: far fa-hands-helping
        id: 5_1481_support

Did this file format change between 2.1.1 and 2.1.2? By using the correct format for conf.yml, Dashy runs, sees the config, and is persistent.

breeegz avatar Apr 09 '24 19:04 breeegz

Hey @breeegz, Sorry for the issues, and thank you for your patience. There haven't been any schema changes, and your config looks all correct to me (except I'm not sure what - &ref_2 at the start of each item is, I've not seen that before - looks like some weird encoding from your OS?).

There's an update coming very soon (likely this Sunday) in #1528 which will fix that. Since it will remove the need for Dashy to ever rebuild between config changes, and instead fetch the latest conf dynamically.

Lissy93 avatar Apr 10 '24 21:04 Lissy93