This repository was archived by the owner on Oct 13, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Demo Deployment
samhuk edited this page Mar 10, 2023
·
5 revisions
You can build and deploy Exhibitor as a static site to demo your component library. You can see a live example of this over at https://demo.exhibitor.dev and the repository that is used for it over at https://github.com/samhuk/exhibitor-demo.
NOTE: This feature is in Alpha status and so production/important use is discouraged.
- Ensure that you have the latest package store data
- Linux-based OS:
sudo apt update && sudo apt upgrade - Windows OS: [Can likely skip this]
- Linux-based OS:
-
Git
- Linux-based OS:
sudo apt install git - Windows OS: Run installer available to download at: https://git-scm.com/download/win
- Linux-based OS:
-
Node.js
- Linux-based OS:
- Install Node.js (this will likely be an old outdated version):
sudo apt install nodejs - Install Node Version Manager (NVM). See guidance at: https://github.com/nvm-sh/nvm
- Re-source your .profile shell startup scripts (or restart your shell)
- See list of available Node.js versions:
nvm list-remote - Download desired Node.js version:
nvm install {version string} - Use desired Node.js version:
nvm use {version string}
- Install Node.js (this will likely be an old outdated version):
- Windows OS:
- Run installer available to download at: https://nodejs.org/en/download/
- Linux-based OS:
-
Docker
- Visit https://docs.docker.com/engine/install/ for guidance for your particular OS.
- Clone your component library (with Exhibitor) code repository onto the host machine you would like to deploy the demo instance on. For example:
git clone https://github.com/your-user-name/your-repo-name.git - cd into your new cloned repository directory:
cd your-repo-name - Download your repository's NPM dependencies:
npm install - It is advised to have a
demonpm script that runs thedemoExhibitor CLI script with your desired arguments. For example:"scripts": { "exh-demo": "exhibitor demo --config=./exh-configs/exh.config.json" }
- Ensure that you have
demo.enableHttpsasfalsein your Exhibitor configuration file. For example:"demo": { "enableHttps": false }
- Build the demo deployment files:
npx exhibitor demo- By default,
./.exh/demowill now be populated with all of the files necessary to deploy.
- By default,
- Build the Docker images:
sudo docker compose -f ./.exh/demo/docker-compose.yaml build - Run it:
sudo docker compose -f ./.exh/demo/docker-compose.yaml up - By default, the Exhibitor Site will now be accessible at http://localhost:80. If you are deploying to a VM (say in the cloud), ensure that port 80 ingress and egress network traffic is not blocked.
- At the moment, only Let's Encrypt is used.
- Ensure that you have a HTTP-only version of your site up and publicly accessible (i.e. by Let's Encrypt). See the previous section HTTP-only Deployment for guidance.
- In your Exhibitor configuration file, set
demo.enableHttpstotrueand provide the domain(s) you would like to register your HTTPS certificate for. For example:"demo": { "enableHttps": true, "httpsDomains": ["demo.example.org"], }
- Note: Failure to specify at least one entry for
httpsDomainswill result in a configuration validation error.
- Note: Failure to specify at least one entry for
- Build the demo deployment files:
npx exhibitor demo - Run certbot with your domain(s) as the last argument:
sudo docker compose -f .exh/demo/docker-compose.certbot.yaml run --rm certbot certonly --webroot --webroot-path /var/www/certbot/ -d demo.example.org- Certbot will contact Let's Encrypt and request a new HTTPS certificate for your domain. If successful, then by default your HTTPS certificate details will be saved to
./.exh/demo/certbot.
- Certbot will contact Let's Encrypt and request a new HTTPS certificate for your domain. If successful, then by default your HTTPS certificate details will be saved to
- Build the Docker images:
sudo docker compose -f ./.exh/demo/docker-compose.yaml build - Run it:
sudo docker compose -f ./.exh/demo/docker-compose.yaml up - By default, the Exhibitor Site will now be accessible at http://localhost:80 and https://localhost:443. If you are deploying to a VM (say in the cloud), ensure that port 80 and port 443 ingress and egress network traffic is not blocked.