Created
April 15, 2021 17:33
-
-
Save gonzaloelipse/2100882cf399681b295135d271a4b968 to your computer and use it in GitHub Desktop.
PHP7 + Apache + mySQL using 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
version: '3' | |
services: | |
mysql: | |
image: mysql:5.7 | |
environment: | |
- MYSQL_DATABASE= | |
- MYSQL_ROOT_PASSWORD= | |
- MYSQL_USER= | |
- MYSQL_PASSWORD= | |
volumes: | |
# Montamos un volumen para MySQL para no perder los datos de bd | |
- ./mysql:/var/lib/mysql | |
expose: | |
- 3306 | |
ports: | |
- 3306:3306 | |
web: | |
image: php:7-apache | |
volumes: | |
# Montamos nuestra web desde fuera en el directorio web del contenedor | |
- ./:/var/www/html | |
expose: | |
- 8000 | |
ports: | |
- 8000:80 | |
links: | |
- mysql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment