Skip to content

Instantly share code, notes, and snippets.

@bdaley
Created May 15, 2019 17:39
Show Gist options
  • Save bdaley/a9d1b184857a4012be300e46485291c2 to your computer and use it in GitHub Desktop.
Save bdaley/a9d1b184857a4012be300e46485291c2 to your computer and use it in GitHub Desktop.
Simple Docker Setup for PHP
version: '3'
services:
db:
image: mysql:5.7
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
volumes:
- "./database:/docker-entrypoint-initdb.d"
ports:
- "3307:3306"
php:
build: ./
command: php -S 0.0.0.0:8000 /app/index.php
ports:
- "8000:8000"
volumes:
- .:/app
FROM php:7.3.5-cli-stretch
RUN docker-php-ext-install mysqli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment