Jun 30, 2024
docker-compose.yml
.version: '3'
services:
php-apache:
image: php:7.4-apache
ports:
- "8080:80"
- "443:443"
volumes:
- ./meu_projeto:/var/www/html
container_name: meu_php_apache
mysql:
image: mysql:latest
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: root
volumes:
- mysql_data:/var/lib/mysql
container_name: meu_db_mysql
depends_on:
- mysql
docker-compose up -d
docker-compose ps
docker-compose stop
docker-compose start
docker-compose down
teste.php
com o código básico do PHP (phpinfo();
)localhost:8080/teste.php
docker-compose exec php-apache docker-php-ext-install mysqli
docker-compose stop
e docker-compose start