installing python in a docker container

1k Views Asked by At

I'm new to coding and been fiddling around with docker containers and services

I have installed a temporary vscode server on my raspberry and deployed on my local lan for accessing it from various machines

Now i've been trying to create a flask app and run it from the container and trying to figure out how to publish and run the flask web server since i can't figure out what ip should i host it on (the default i always used was host=127.0.0.1 port=8080, but that would bring me to the local machine i'm visiting it from)

So while i was troubleshooting to understand what to do with exposed ports etc i've stopped the container and changed the docker-compose file, (i have a path set for the config's permanent storage, so my vscode setting are actually saved and persistent between deployments)

But I'm having the problem that every time i stop and re deploy the container i loose my python3 installation, and have to re run apt-update, apt-upgrade, apt install python3-pip and every python packages i need for the project

Where am i going wrong?

Silly question, but where does python get installed, and why isn't it persistent since i have my config path set?

I read that python gets installed in usr/local/lib, should i also map those directories to the persistent storage folder?

how should i do that?

thanks

0

There are 0 best solutions below