i'm trying to set up a laravel project with mysql, phpmyadmin on docker. All the configurations seem to be good since docker-compse up
starts all.
But when i try to acces to the default page i go that error on the log :
webserver | 2020/02/03 09:02:36 [crit] 6#6: *4 stat() "/var/www/public/" failed (13: Permission denied), client: 172.18.0.1, server: , request: "GET / HTTP/1.1", host: "localhost"
webserver | 2020/02/03 09:02:36 [crit] 6#6: *4 stat() "/var/www/public/" failed (13: Permission denied), client: 172.18.0.1, server: , request: "GET / HTTP/1.1", host: "localhost"
webserver | 2020/02/03 09:02:36 [crit] 6#6: *4 stat() "/var/www/public/index.php" failed (13: Permission denied), client: 172.18.0.1, server: , request: "GET / HTTP/1.1", host: "localhost"
My dockerfile contains that:
# Add user for laravel application
RUN groupadd -g 1000 www
RUN useradd -u 1000 -ms /bin/bash -g www www
# Copy existing application directory contents
COPY . /var/www
# Copy existing application directory permissions
COPY --chown=www:www . /var/www
# Change current user to www
USER www
and ls -la
in the containers returns:
drwx------ 2 www www 4096 Oct 18 20:10 config
drwx------ 5 www www 4096 Oct 18 20:10 database
-rw-rw-r-- 1 www www 1358 Feb 3 08:48 docker-compose.yml
drwx------ 2 www www 4096 Oct 18 20:10 mysql
drwx------ 3 www www 4096 Oct 18 20:10 nginx
-rw-rw-r-- 1 www www 1125 Oct 18 20:10 package.json
drwx------ 2 www www 4096 Oct 18 20:10 php
-rw-rw-r-- 1 www www 1156 Oct 18 20:10 phpunit.xml
drwxrwxrwx 4 www www 4096 Oct 18 20:10 public
drwx------ 6 www www 4096 Oct 18 20:10 resources
drwx------ 2 www www 4096 Oct 18 20:10 routes
-rw-rw-r-- 1 www www 563 Oct 18 20:10 server.php
I don't know what's wrong. i found this Permission Denied Error using Laravel & Docker but i doesn't works.