Strapi V4 lose these medias files on every deploy on Render

Hello,

On every deploy of my Strapi V4 i lose my medias library, each files path are broken.

Do you have an idea of what’s happen with this issue

i use this config to deploy on render

# STRAPI
- type: web
  name: phd-strapi
  env: node
  plan: starter
  region: frankfurt
  buildCommand: yarn && yarn workspace strapi build
  startCommand: yarn workspace strapi start
  healthCheckPath: /_health
  disk:
    name: strapi-uploads
    mountPath: /opt/render/project/src/public/uploads
    sizeGB: 1
  envVars:
    - key: NODE_VERSION
      value: 16.15.1
    - key: NODE_ENV
      value: production
    - key: DATABASE_URL
      fromDatabase:
        name: phd-inov-database
        property: connectionString
    - key: JWT_SECRET
      generateValue: true
    - key: ADMIN_JWT_SECRET
      generateValue: true
    - key: APP_KEYS
      generateValue: true
    - key: API_TOKEN_SALT
      generateValue: true

Welcome to the Strapi Community :handshake:
I’m going to guess the reason might be that if you want to use binds like this, you also need to make sure that folders exists (check that it has a .gitkeep inside of it) Else it won’t exists and it doesn’t get created.

But I would rather suggest use a storage provider then bind the uploads mountPath etc.

From a docker perspective remember that each instance or when the server is empherial (I’m going to guess that Render gives a storage disk you can mount to it etc) but make sure the path then is correct and matching up with strapi etc.

I am not sure what the render.yaml from the template does differently: https://github.com/render-examples/strapi-sqlite/blob/master/render.yaml there are some differences, for example the rsync here: startCommand: rsync -a public/ /data/public/ && yarn start
I used this template and the media files get retained.