diff --git a/README.md b/README.md index d5716caf..c7f27b2f 100644 --- a/README.md +++ b/README.md @@ -36,34 +36,37 @@ Demo

-![More themes and screens](https://i.ibb.co/M6nyvqW/dashy-options-screen.png) - --- ## Running the App 🏃‍♂️ -### Deploying 🚀 + +### Deploying from Docker Hub 🐳 + +```docker +docker run -d \ + -p 8080:80 \ + -v /root/my-local-conf.yml:/app/public/conf.yml \ + --name my-dashboard \ + --restart=always \ + lissy93/dashy:latest +``` +After making changes to your configuration file, you will need to run: `docker exec -it [container-id] yarn build` to rebuild. Container ID can be found by running `docker ps` + +### Deploying from Source 🚀 - Get Code: `git clone git@github.com:Lissy93/dashy.git` and `cd dashy` - Configuration: Fill in you're settings in `./public/conf.yml` - Install dependencies: `yarn` - Build: `yarn build` - Run: `yarn start` -### Deploying with Docker from Source 🛳️ -- Get Code: `git clone git@github.com:Lissy93/dashy.git` and `cd dashy` -- Configuration: Create a YAML file with your configuration -- Build: `docker build -t dashy .` -- Start: `docker run -p [port]:80 -v [/path/to/local/conf.yml]:/app/public/conf.yml --name [my-dashboard] dashy` - -### Deploying from Docker Hub 🐳 -- Get the Image: `docker pull lissy93/dashy` -- Start the Container: `docker run -d -p 8080:80 /path/to/local/conf.yml:/app/public/conf.yml --name my-dashboard lissy93/dashy` +After making changes to your configuration file, you will need to run: `yarn build` to rebuild ### Developing 🧱 - Get Code: `git clone git@github.com:Lissy93/dashy.git` and `cd dashy` - Install dependencies: `yarn` - Start dev server: `yarn dev` -Note that although recommended, it is not required to use the conf.yml file- all settings can be specified through the UI, and backed up on the cloud. +Hot reload is enabled, so changes will be detected automatically, triggering the app to be rebuilt and refreshed --- @@ -77,7 +80,7 @@ Configuration files are located in [`./public/`](https://github.com/Lissy93/dash Also within `./public` you'll find normal website assets, including `favicon.ico`, `manifest.json`, `robots.txt` and `web-icons/*`. There's no need to modify these, but you can do so if you wish. -Note that the conf.yml file is where all config is read from. If you make any modifications through the web interface, you will need to export them into this file in order for your changes to persist. +Note that the conf.yml file is where all config is read from. If you make any modifications through the web interface, you will need to export them into this file in order for your changes to persist. Since the app is compiled for faster loading, you will need to rebuild it with `yarn build` (or `docker exec -it [container-id] yarn build` of you're using Docker) ### The Conf File 📄 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..767488ca --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +--- +version: "3" +services: + dashy: + image: lissy93/dashy + container_name: dashy + volumes: + - /root/my-config.yml:/app/public/conf.yml + ports: + - 8080:80 + environment: + - UID=1000 + - GID=1000 + restart: unless-stopped \ No newline at end of file diff --git a/server.js b/server.js index d277fe53..542a0ba6 100644 --- a/server.js +++ b/server.js @@ -40,8 +40,8 @@ const overComplicatedMessage = (ip, port) => { + `${chars.CYAN}${chars.BOLD}Welcome to Dashy! 🚀${chars.RESET}${chars.BR}` + `${chars.GREEN}Your new dashboard is now up and running ` + `${containerId ? `in container ID ${containerId}` : 'with Docker'}${chars.BR}` - + `After updating your config file, run '${chars.UNDERLINE}docker exec -it ` - + `${containerId || '[container-id]'} yarn build` + + `${chars.GREEN}After updating your config file, run ` + + `'${chars.UNDERLINE}docker exec -it ${containerId || '[container-id]'} yarn build` + `${chars.RESET}${chars.GREEN}' to rebuild${chars.BR}` + `${chars.BLUE}${stars(91)}${chars.BR}${chars.RESET}`; } else {