I want use docker as backend after some years with LAMP, I'm using docker with docker-compose.
Here docker-compose.yml:
services:
php:
image: php:8.0-apache
container_name: php
restart: always
ports:
- "80:80"
volumes:
- /var/www/docker/php:/var/www/html
- ./conf:/etc/apache2/sites-available
links:
- db:db
db:
image: mysql
container_name: db
restart: always
volumes:
- ~/mysql:/var/lib/mysql
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=root
admin:
image: phpmyadmin/phpmyadmin
container_name: admin
ports:
- "8080:80"
links:
- db:db
So I erase /etc/apache2/sites-available who already contain 000-default.conf with my local.dev.conf:
<VirtualHost *:80>
DocumentRoot /var/www/html/
ServerName local.dev
<Directory /var/www/html/>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
I put a basic index.php file in /var/www/html in container that displays 'test' but it only displays at http://localhost and I want it at http://local.dev
I saw there is a file docker-php.conf but how to change it cause erase 000-default.conf seems change nothing?