I’m trying to configure a laravel app with docker but when I try to access I get an 403 error
You don't have permission to access this resource.
this is the Dockerfile
FROM php:7.4-apache
RUN pecl install xdebug-3.1.1 && docker-php-ext-enable xdebug
RUN apt-get update && apt-get install -y
libfreetype6-dev
libjpeg62-turbo-dev
libpng-dev
libzip-dev
zip
&& docker-php-ext-configure gd --with-freetype --with-jpeg
&& docker-php-ext-install -j$(nproc) gd pdo pdo_mysql zip
RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.start_with_request=yes" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.client_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN a2enmod rewrite
EXPOSE 9003
WORKDIR /var/www/html
COPY . /var/www/html
COPY apache-config.conf /etc/apache2/sites-available/000-default.conf
CMD ["apache2-foreground"]
this is the docker-compose.yml
version: '3.8'
services:
php:
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/var/www/html
- ./xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
ports:
- "8000:80"
depends_on:
- mysql
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
XDEBUG_MODE: "develop,debug"
XDEBUG_CONFIG: "client_host=host.docker.internal start_with_request=yes"
container_name: myapp_api_webserver_and_php
mysql:
image: 'mariadb:10.6'
container_name: myapp_api_db
environment:
- MYSQL_ROOT_PASSWORD=secret
- MYSQL_DATABASE=mydb
- MYSQL_USER=myuser
- MYSQL_PASSWORD=pass
ports:
- '8003:3306'
and this is apache-config.conf file
<VirtualHost *:8000>
DocumentRoot /var/www/html/public
<Directory /var/www/html/public>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Do I missed something in the configuration?I have to set something else on the web server permissions?