Improve images storing functionality #3258
Replies: 3 comments
-
Allow me to disagree with you. This is especially the case if you migrate from a different e-commerce solution and your media is already stored somewhere else. In my specific case, I have stuff on S3, B2, and Minio and it just works. If I ever merge all the media, I can run an UPDATE query on PostgreSQL and call it a day, it's that simple. |
Beta Was this translation helpful? Give feedback.
-
You could use rewrites to make the host fit your needs |
Beta Was this translation helpful? Give feedback.
-
We could maybe improve the plugin with an additional field like "relativePath" and also add support for Minio folder in the config. Ideally I would like to see the same config options as the ones available in this Strapi plugin that I'm using in my production environment : https://github.com/flyce/strapi-provider-upload-minio-ce |
Beta Was this translation helpful? Give feedback.
-
Currently, when Medusa saves images it saves the full URL in the database.
This is not a good approach as it locks developers to change images storage.
I have Medusa installed with Docker, and I use MinIO as storage.
When I save an image from the Medusa Admin it saves it to the MinIO bucket, but as the Medusa backend run inside of the Docker container, it interacts with MinIO using a host that is available only inside of the Docker container, and my browser can't access image by that host.
For example:
Medusa saves the image path as http://minio:9000/medusa/my-image.jpeg, but it is not accessible from the browser.
The browser can access the image using localhost http://localhost:9090/medusa/my-image.jpeg.
So it will be perfect to save only relative paths of images to the database.
In that case, we will avoid saving extra data to the database and can have an environment variable that will make images storage host configurable.
Beta Was this translation helpful? Give feedback.
All reactions