Last active
October 12, 2018 17:32
-
-
Save romaricdrigon/216c3eb54fc874a32b657549ef6208e4 to your computer and use it in GitHub Desktop.
Minimal docker LAMP setup
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: '2' | |
volumes: | |
mysqldata: ~ | |
services: | |
php: | |
image: php:7.2-apache | |
depends_on: | |
- mysql | |
volumes: | |
- .:/var/www/html | |
working_dir: /var/www/html | |
ports: | |
# On se lit au port 80 local, mais on pourrait aussi en choisir un autre comme par exemple "8080:80" | |
- "80:80" | |
mysql: | |
image: mysql:5.7 | |
volumes: | |
- mysqldata:/var/lib/mysql | |
environment: | |
# Nécessaire | |
- MYSQL_ROOT_PASSWORD=rootpass0 | |
# On peut configurer sa BDD et les credentials pour s'y connecter | |
- MYSQL_DATABASE=mydb | |
- MYSQL_USER=dbuser | |
- MYSQL_PASSWORD=dbpass | |
ports: | |
# On rend la BDD accessible depuis notre ordinateur pour le débug | |
- "3306:3306" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment