loco
loco copied to clipboard
feat: nginx deployment
Implement and add to our CLI the generation of the nginx conf file for deployment as mentioned in the issue: [(https://github.com/loco-rs/loco/issues/203)]
@jondot I had some questions about whether for now we can start with the simplest implementation and wait for demand, or whether we could think about SSL and TLS. Regarding the current implementation, it is very simple looking directly at the configurations made.
Looks great! I think simplicity is a fantastic thing :)
What do you think about looking a the docker-compose https://github.com/clowzed/sero/blob/master/docker-compose.yml and trying to customize this one to our needs? then drop the generated docker-compose file in ngnix/
as well. This will be a great "dont make me think" feature that will streamline deploying under nginx.
Only add it if its not too complicated, if you find that it involved some jumping through hoops, we can leave it to later :)
You can also look at our docker-compose in the starters template: https://github.com/loco-rs/loco/blob/master/starters/saas/.devcontainer/docker-compose.yml
Not to be annoying, I know that nginx is the default for this problem. But maybe it would be nice to add traefik, it integrates nicely with docker-compose (adding a couple of labels) and you can get lets encrypt certificates set up quite easily.
Hi To learn more about this PR, I revised arferreira's patch into my patches in my forked repository](https://github.com/loco-rs/loco/compare/master...locoabc:loco:adding-Nginx-deployment-template). Please review and confirm.
- Not sure why (purposely ?) deployment_nginx_config.t is missed in templates dir
- content of deployment_nginx_config.t
to: "Nginx.toml"
skip_exists: true
message: "Nginx.toml file created successfully"
---
name = "{{pkg_name}}"
- testing generate deployment
[me@rocky9t01a myapp04]$ myapp04-cli generate deployment
โ โฏ Choose your deployment ยท Nginx
added: "nginx/default.conf"
added: "Nginx.toml"
[me@rocky9t01a myapp04]$
going to move forward with this one