How to Deploy Applications
A Salvo project, after compilation, becomes an executable file. For deployment, you only need to upload this executable along with its dependent static resources to the server.
For Rust-based projects, there is also a very simple deployment platform: shuttle.rs. Shuttle provides support for Salvo-like projects. For details, please refer to the official documentation.
Docker Deployment
You can also use Docker to deploy Salvo applications. Below is a basic Dockerfile example, which you can adjust according to your project's requirements:
Usage Instructions
- Save the above
Dockerfilein your project's root directory. - Adjust
your_app_nameto the actual binary file name according to your project. - If your application requires static files (such as templates, CSS, JS, etc.), you can add corresponding
COPYcommands. - If your application requires environment variable configuration, you can use the
ENVinstruction. - Build the Docker image:
- Run the container:
Please adjust the port number and other configurations according to your application's actual needs.