Hi guys, I have a dockerized python server that needs a mysql db.
My python server dockerfile build from
craigham/pandas:latest because it has already compiled some crucial libraries for the project.
To build my image for pi3 I run
docker buildx build --platform linux/arm/v7 -t nick/my-project .
So I couldn’t just
balena push instead I build locally my image and run
Reading balena docks and the forum I have understood that I need a multicontainer setup, one container for mysql db and one for my python server. So I need to deploy a docker-compose file.
In order to have my db data persisted every time I release a new version of my python server I have to (Q1)
- store the db data under
/datainside the mysql container
- OR create a volume for my data that mounts a balena os host directory with mysql
can’t really understand it from the docs.
My next problem is, lets say I have an sql dump for my db, how can I load it on my db container?
I suppose I have to somehow move it in my balena os host, then create a volume that mounts on /data of mysql container and the dockerfile of my db will execute the command to load the data?
To conclude, high level I need a docker-compose file that sets up the two services and each one has its own dockerfile.
To run my buildx command from the docker-compose I have to create my image, put it in a repo and mention it in the docker-compose?
Thank you in advance guys, please keep the answers stupid simple newbie here!