Docker work flow and setup - can't get my head around it

OK so i have 4 applications that a develop and maintain. I do all of the work.

I have 2 public facing websites, 1 internal CRM, and an internal WMS system. All of these are written using flask.

I am trying to figure out how setup the development side. So under the docker philosophy each one of these would have their own matching database containers and nginx container. I would run them using something like gunicorn on restart mode. I would have the source directory linked as a volume inside the container. This lets be do docker-compose up and i can start working.

However i have no way of no way of making the data persistent unless i set up a volume on my machine to hold the data files for the databases. This works but it writes everything to user 999:999 and my local user is then locked out of editing the file unless i chmod g+wrx on the folders. That doesn’t seem portable to me.

Now on production side i can’t have 4 different nginx services running on the same server so i only need one that proxy’s for all the other web apps. Ok this doable but again now i have to have different docker-compose files for development and production i also still have the same issue with persisting data and permission issues on the local files.

I know i am missing something obvious but the workflow is clunky and requiring tinkering between dev and prod which is what i was hopping to solve.