Skip to content

Instantly share code, notes, and snippets.

@gonzaloelipse
Created April 15, 2021 17:33
Show Gist options
  • Save gonzaloelipse/2100882cf399681b295135d271a4b968 to your computer and use it in GitHub Desktop.
Save gonzaloelipse/2100882cf399681b295135d271a4b968 to your computer and use it in GitHub Desktop.
PHP7 + Apache + mySQL using Docker Compose
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