You'll need to use the nightly Rust toolchain, and install the wasm32-unknown-unknown target as well as the Trunk and cargo-leptos tools:
rustup toolchain install nightly
rustup target add wasm32-unknown-unknown
cargo install trunk cargo-leptos
Install TailwindCSS with npm install -D tailwindcss
To run the project locally,
- run
npx tailwindcss -i ./input.css -o ./style/output.css --watchin a terminal - this will buildstyle/output.cssand automatically rebuild when a change is detected ininput.css cargo leptos watchin the project directory.- In in your browser, navigate to http://localhost:8008/?
After running a cargo leptos build --release the minimum files needed are:
- The server binary located in
target/server/release - The
sitedirectory and all files within located intarget/site- css files will be in the target/site too.
- The
Dockerfileanddocker-compose.ymllocated indocs/directory - you may alreay set your domain-name dns pointing to your remote server IP Address
Copy these files to your remote server. The directory structure should be:
siamstr
site/
Dockerfile
docker-compose.yml
users.json (optional)
database.db (auto-generated)
you should have certbot docker nginx installed on your remote server if not:
Ubuntu
sudo apt install certbot nginx docker docker-composeDebian should follow the installtion process on docker website
sudo apt install certbot nginxsetting up certbot and nginx config:
sudo certbot certonly --nginx -d example.com
# sudo certbot certonly --nginx -d www.siamstr.com (optional)Copy text inside nginx.config and paste into /etc/nginx/site-enabled/default and restart nginx service
sudo systemctl restart nginx.serviceThen start docker compose:
docker compose up