-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Media directory permissions problem using Docker (Sylius 1.12.1) #893
Comments
but as soon as you upload new image, it will not work. |
Trying with: liip_imagine:
resolvers:
default:
web_path:
web_root: "%kernel.project_dir%/public"
cache_prefix: "media/cache"
loaders:
product_images:
flysystem:
filesystem_service: oneup_flysystem.product_images_filesystem
data_loader: product_images
oneup_flysystem:
adapters:
product_images:
local:
location: "%kernel.project_dir%/public/media/image"
permissions:
file:
public: 0777
private: 0777
dir:
public: 0777
private: 0777
filesystems:
product_images:
adapter: product_images But still no luck, it creates dirs without |
Still an issue. The image folder only has permissions for root or www-data. The cache folder only has permission for the owner. Since the nginx container runs with a different user (nginx) it cannot read any cache or no-cached image. The cached image files themselves are not the problem but the folder permissions are the too restrictive ones. Edit: |
Any update in the 1.13 branch ? Somehow my In my case Sylius is used as an API for Next js app I also have some trouble having Sylius generating all the necessary thumbnails sizes when an image is added
It would be better in this case to use the original image that gets into the Nginx permission issue |
Sylius version affected: 1.12.1
Description
I just installed Sylius
1.12.1
via Docker (following the documentation) and when I want to upload an image to a product from the admin panel, I get this permissions error:2022/12/16 13:26:12 [crit] 32#32: *843 stat() "/srv/sylius/public/media/cache/sylius_small/50/09/d7acd0e47c4b6c598e5fd25fd206.jpg" failed (13: Permission denied), client: 172.18.0.1, server: , request: "GET /media/cache/sylius_small/50/09/d7acd0e47c4b6c598e5fd25fd206.jpg HTTP/1.1", host: "localhost", referrer: "http://localhost/admin/products/22/edit"
However, there are these lines in the
docker/php/docker-entrypoint.sh
file which is supposed to define the rights on thepublic/media
folder :media
directory inphp
container:By the way, I think that if you install Sylius via Docker, the product images (generated by fixtures) will not be displayed on the website because of the permissions.
@nicolalazzaro has the same problem and he didn’t have this problem in the past, so I think the problem is not my setup.
Steps to reproduce
Products > Media
I tried with 1.12.0 version and same problem.. 😕
I use Docker Desktop 4.15.0 on MacOS Monterey.
Possible Solution
?
The text was updated successfully, but these errors were encountered: