I try to setup a PHP (vanilla) project with MVC architecture and docker-compose.
For my docker web service i use : php:7.2.2-apache
So it's look like:
This is my docker-compose:
version: '3'
services:
db:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: pass
MYSQL_DATABASE: db
ports:
- "9906:3306"
web:
build:
dockerfile: php.Dockerfile
context: .
container_name: php_web
depends_on:
- db
volumes:
- ./:/var/www/html/
ports:
- "8080:80"
stdin_open: true
tty: true
phpmyadmin:
image: phpmyadmin/phpmyadmin
depends_on:
- db
external_links:
- db:mysql
ports:
- "9191:80"
environment:
MYSQL_USER: root
MYSQL_PASSWORD: pass
MYSQL_ROOT_PASSWORD: pass
PMA_HOST: db
and my .htaccess
RewriteEngine On
RewriteRule .* index.php
Without .htaccess i can go to localhost and see my index.php, but with .htaccess i have a 500 Internal Server Error
How can i properly configure my project ? I try to follow this -> MVC - Stackoverflow and MVC - Github
