build docker image

Build the image with multi-stage

docker build -t aduyng/home-automation-dashboard:latest .

Run the ngnix image

docker run -p 8080:80 aduyng/home-automation-dashboard:latest

steps to deploy to raspberry pi

  1. build the app
    npm run build
  2. copy to the target raspberry pi
    scp -r build pi@192.168.86.7:/home/pi/Downloads/
  3. ssh into pi and move the file to document root of nginx
    ssh pi@192.168.86.7
    sudo rm -rf /var/www/html/*
    sudo mv /home/pi/Downloads/build/* /var/www/html/
  4. reboot the pi
    sudo reboot