Update docker-compose.yml | Issue#1933#1935
Update docker-compose.yml | Issue#1933#1935KjellWolf wants to merge 1 commit intosteve-community:masterfrom
Conversation
Making the DB volume persistent. Adding options to use a .env gile
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
| image: mariadb:10.4.30 | ||
| restart: unless-stopped | ||
| ports: | ||
| - 3306:3306 |
There was a problem hiding this comment.
hey there, thanks for the effort.
this means that the database will not be accessible from localhost (let's say from a dev machine), right? it would be a little bit counter-productive IMO.
There was a problem hiding this comment.
Maybe there should be a Prod and Dev Compose file? or just commented out?
Having unnessesary ports open for prod is dangerus. Sadly most people deploy without thinking.
There was a problem hiding this comment.
hmm. to be frank, i never never considered this docker-compose (or any kubernetes-related additions) for prod. i think both of them are too context-dependent and should be tuned to the org's infra.
this docker-compose for me is just a developer convenience shortcut to start steve easily in 1 step.
There was a problem hiding this comment.
for example, my definition/interpretation of prod would be some managed database by the cloud provider i am using, such that this mysql/mariadb in docker-compose is completely unnecessary. there are so many downsides IMO to run a database locally like this. but every org's prod choices, context and configuration is different. it is too nuanced to cover in this project.
There was a problem hiding this comment.
Well most people i know nowdays see docker and use docker. Its just easy. Like you mentioned. And most People simly prefer containerized applications over bare metal installs
Especially if its not explicit stated that its Dev only.
And IMO prod users should have the option for Docker too :D
And maybe consider then "keep it simple" for the majority who just see and use and make it complex(er) for those who use it for Dev.
There was a problem hiding this comment.
And IMO prod users should have the option for Docker too :D
my suggestion was not to run the app on bare metal or without docker. i have nothing against docker. my argument was that the dockerization of the app and the interplay with other components on your platform might look different from what is prescribed in the docker-compose.
going back to your earlier argument, i guess we could have two docker-compose files: dev and prod. dev should be easy to use without modification. prod can be safer and more elaborate.
User description
Making the DB volume persistent.
Adding options to use a .env file
Removing the DB Port mapping
Based on my Issue #1933
PR Type
Enhancement
Description
Remove database port mapping for security
Make database volume persistent with named volume
Support environment variable configuration with defaults
Improve database credentials security and flexibility
Diagram Walkthrough
File Walkthrough
docker-compose.yml
Persistent storage and environment variable configurationdocker-compose.yml
db-datafor persistent database storageusing
${VAR:-default}syntaxchangemetochangeMe!for bettersecurity