Created
January 13, 2018 15:31
-
-
Save victorhugorch/1af3111e6d57d1145a2ab6df0cc86dbb to your computer and use it in GitHub Desktop.
Docker-compose file to create containers with php7 and mysql.
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
# v2 syntax | |
version: '2' | |
# Named volumes | |
volumes: | |
# MySQL Data | |
<app-name>-mysql-data: | |
driver: local | |
services: | |
# MySQL (5.7) | |
mysql: | |
image: ambientum/mysql:5.7 | |
container_name: <app-name>-mysql | |
volumes: | |
- <app-name>-mysql-data:/var/lib/mysql | |
ports: | |
- "3306:3306" | |
environment: | |
- MYSQL_ROOT_PASSWORD=<app-name> | |
- MYSQL_DATABASE=<app-name> | |
- MYSQL_USER=<app-name> | |
- MYSQL_PASSWORD=<app-name> | |
# PHP (with Caddy) | |
app: | |
image: ambientum/php:7.1-caddy | |
container_name: <app-name>-app | |
volumes: | |
- .:/var/www/app | |
ports: | |
- "80:8080" | |
links: | |
- mysql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment