-
-
Save locserd/9e144225d1ace88808873d0258d2f156 to your computer and use it in GitHub Desktop.
Criando um ambiente de desenvolvimento PHP com Docker Compose
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php: | |
build: ./Dockerfile | |
ports: | |
- "81:81" | |
- "443:443" | |
volumes: | |
- ./www:/var/www/html | |
links: | |
- db | |
db: | |
image: mysql:5.7 | |
volumes: | |
- /var/lib/mysql | |
environment: | |
- MYSQL_ROOT_PASSWORD=phprs | |
- MYSQL_DATABASE=phprs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:5.6-apache | |
RUN docker-php-ext-install mysqli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo "<pre><h2>Criando um ambiente de desenvolvimento PHP com Docker Compose.</h2></pre><br/>"; | |
mysqli_connect("db", "root", "phprs") or die(mysqli_error()); | |
echo "<pre><h3>Connected to MySQL<h3></pre><br/>"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment