3 ms·
> A big aspect of what I'm wondering is about automatically setting something up for keeping local/production environments in sync, quickly deploying to product
by madhadron 8y ago
> A big aspect of what I'm wondering is about automatically setting something up for keeping local/production environments in sync, quickly deploying to production, and not having to mess with a bunch of server configuration things, user accounts, security, etc.
Here's the simplest operational approach that I have yet found. Use Amazon RDS to run PostgreSQL as your production database. Architect your system to be one, static binary that is its own web server, contains all web assets compiled in, everything. It takes its configuration from a very small number of environment variables.
Start a CentOS VM. Copy the binary to it. Write a systemd service definition that sets the appropriate environment variables and runs the service as a dynamic user (so you don't have to worry about setting up accounts on the VM). Copy that definition to the VM and run `systemd daemon-reload` to make that service available. To deploy a new version, copy static binary of the new version to the VM and restart the service.
That glosses over lots of details, but it's your starting point for thinking about this. Every deviation adds operational complexity and has to pay for itself in reduced effort elsewhere.
- 49bc 8y agoMost languages don’t support static binaries. Other than Go I can’t think of any that make it easy.
- madhadron 8y agoYup. It's a pain. A first compromise is to have the language runtime installed, and create a single file for your code and assets, such as a heavy JAR for JVM based languages or an egg in Python.