0

I have a problème with docker-compose. I am using a developpement configuration with docker-compose.

my docker-compose.yml :

version: '3'
services:
  # base de données mysql
  database:
    image: mysql:5.7
    container_name: mysql57_Adhesion
    ports:
      - 3306:3306
    expose:
     - 3306
    volumes:
     - /data/dev/docker/composePhpAdhesion/database:/var/lib/mysql
    environment:
     - MYSQL_ROOT_PASSWORD=myPassword



  # apache 2.4 et php 5.6 fourni par le fichier Dockerfile
  php:
    build: .
    container_name: apache24_php56_Adhesion
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /data/devPhp/workspace:/var/www/html
    links:
      - database
    environment:
      PMA_HOST: database
      PMA_PORT: 3306

I mount apache /var/www/html to a specific directory /data/devPhp/workspace on the machine.

It works pour simple apache conf file (000-default.conf) with :

   DocumentRoot /var/www/html

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /var/www/html>
            Options Indexes FollowSymLinks Includes ExecCGI
            AllowOverride All
            Require all granted
    </Directory>

In this case :

works.

But for laravel 5 i need a specific documentroot directory :

   DocumentRoot /var/www/html/adhesion/public

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /var/www/html/adhesion/public>
            Options Indexes FollowSymLinks Includes ExecCGI
            AllowOverride All
            Require all granted
            # RewriteEngine On
            # RewriteRule ^(.*)$ public/$1 [L]
    </Directory>

and it doesn't work ... This urls :

fail with 404 error ...

Thanks in advance for any idea.

EDIT/UPDATE:

improve formatting

ratm
  • 913
  • 1
  • 11
  • 20

1 Answers1

0

The apache mod-rewrite is essential for laravel !!!!

How to enable mod_rewrite on Apache 2.4?

with mod_rewrite on the url http://localhost/adhesion/ is working !

ratm
  • 913
  • 1
  • 11
  • 20