3 ms·
Interesting post, I liked the deploy script that keeps the app versioned in the server, which is helpful to do rollbacks. I have been running a similar setup f
by AlexITC 3y ago
Interesting post, I liked the deploy script that keeps the app versioned in the server, which is helpful to do rollbacks.
I have been running a similar setup for many years with some differences:
1. Use `EnvironmentFile` on systemd to load environment variables instead of bundling secrets into the binary.
2. Set `LimitNOFILE=65535` on the service to avoid reaching the file open limit on the app.
3. Set `StandardError=journal` and `StandardOutput=journal` so that `journalctl` can display the app logs.
4. Use postgres instead of sqlite, DO is taking regular backups for me and postgres maintenance is almost null for simple apps.
5. Nginx can have password-protected endpoints, which are useful to expose the app logs without requiring to ssh into the VM.
6. Nginx can also do pretty good caching for static assets + API responses that barely change, this is very helpful for scaling the app.
At last, I use ansible but I'm considering if its worth it, replacing it seems simple and I'd be able to keep a single deploy file that runs faster than ansible.