0

I can upload a file but not delete it.

I have a nginx, laravel, and redis containers.

When I upload my queue create files and folders into /var/www/storage/app/public (laravel container)

This folder is share with the host by a docker volume.

When I try to remove the file and the folder I can't because I don't have permissions...

I tried to change php-fpm user from www-data to root in www.conf I tried to launch supervisord queue process and fpm as root user

www.conf

; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
;       will be used.
user = www-data
group = www-data

supervisord.conf

[program:php-fpm]
command=/usr/local/sbin/php-fpm -F
autostart=true
autorestart=true
priority=5
stdout_events_enabled=true
stderr_events_enabled=true

[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/artisan queue:work redis --sleep=3 --tries=3
autostart=true
autorestart=true
user=root
numprocs=8
priority=10
redirect_stderr=true
stdout_logfile=/var/www/storage/logs/worker.log
Shanteshwar Inde
  • 1,438
  • 4
  • 17
  • 27
Daedelus
  • 89
  • 1
  • 11

2 Answers2

1

I found the solution so if some one of you have this kind of issue.

I finnally change user of Redis in my supervisord conf to match the user conf of php fpm (so www-data instead of root)

Tada it’s works fine

Daedelus
  • 89
  • 1
  • 11
0

I understand your cant remove files or folder in container, maybe you can see: Can't Delete file created via Docker

Ryoma
  • 64
  • 1
  • 9
  • Yeah sure, because my php process worked as www-data and my container as root maybe that's the problem.. but I don't want to do a chown each time I create a file according to your link.. do you understand ? – Daedelus May 14 '19 at 12:37
  • The link mean you can chown when you are create container, not each time.Maybe you can see again – Ryoma May 14 '19 at 12:52
  • ha yes I'll try it – Daedelus May 14 '19 at 13:42