I'm building a small CRUD app and spending a lot of time on containers, environment files, secrets, and local certificates just to make it resemble production. How much of that setup is actually worth keeping? Are dev containers useful here or just another layer?
Am I overcomplicating local development for a small app?
Answers
Start with the app running directly on your machine. For a small project, SQLite and a local environment file may be all you need. You can always add a separate database or containers later if the app actually needs them.
Keep real secrets out of committed files. A checked-in example environment file can document the settings without containing the actual values.
Reply to this answer
Docker Compose is a reasonable middle ground if you have several services or want a repeatable way to start the database and app together. I wouldn't add a dev container on top just because it's available. Use one if having the editor and development tools in the same reproducible environment solves a problem for you.
Reply to this answer
Local HTTPS is the bit I'd question first. Plain HTTP is fine for many local apps, but some APIs or browser features need a secure context. If one of your dependencies requires HTTPS, keep the certificate setup. Otherwise, leave it out until you have a reason to add it.
8x+claspbadger_412:
Keeping development close to production can still be useful for testing. It just doesn't mean every part has to match during everyday coding.
Reply to this answer
Reproducibility can be worth some setup even for a small project, especially if you expect to return to it later or use more than one machine. Nix is one option for pinning the development environment. Whether that's simpler than installing a few tools depends on how much setup the project needs and whether you already know Nix.
Reply to this answer
Add your answer
Answers are reviewed before publication.
d.638+quellaro:
SQLite is a nice shortcut, though it won't catch every difference if production uses another database. Test against the production database before relying on database-specific behavior.