Dockerize old App - User Files Storage managment

Hi guys,

I work with docker since 3 years and love all container things.
I am facing a problem that i couldn’t figure it out.

I have an old production webserver with php apps (VPS) (custom online shop, wordpress,…). Some apps are still under development (fixes, new features) and i started dockerized all this apps.

I have an other VPS, fresh installed with docker and docker compose. I want to transfer all the dockerized apps to this server.

For the apps that are still under development, i would like to use CI/CD. The idea is to build, copy project files into an image and deploy/update the new version of the containerized app.

I would like to understand how to manage files that are created by users (like uploaded profile images). I don’t want to use an external data storage (like S3) and want to keep it all on the new server.

Is there a best practice to manage user files ?

For example, do i need to create a volume only for user files (shared folders) ? So when i update the docker image, i could persist the files between images.

I hope you understand what i mean.

Thanks for your help