Skip to content

Instantly share code, notes, and snippets.

@alysivji
Last active February 27, 2018 01:22
Show Gist options
  • Save alysivji/ec2a753f9303404c0825ef73647bdecf to your computer and use it in GitHub Desktop.
Save alysivji/ec2a753f9303404c0825ef73647bdecf to your computer and use it in GitHub Desktop.
Container-based PHP + MySQL development environment
version: '3'
services:
db:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: my_secret_pw_shh
MYSQL_DATABASE: test_db
MYSQL_USER: devuser
MYSQL_PASSWORD: devpass
ports:
- "9906:3306"
web:
image: php:7.2.2-apache
container_name: php_web
depends_on:
- db
volumes:
- ./php/:/var/www/html/
ports:
- "8100:80"
stdin_open: true
tty: true
<html>
<head>
<title>Hello World</title>
</head>
<body>
<?php
echo "Hello, World!";
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment