Skip to content

Instantly share code, notes, and snippets.

@jvdi
Last active October 18, 2020 16:14
Show Gist options
  • Save jvdi/964e9e5f7fc83f7c25866f37724f2304 to your computer and use it in GitHub Desktop.
Save jvdi/964e9e5f7fc83f7c25866f37724f2304 to your computer and use it in GitHub Desktop.
Simple Nginx Php MySQL Server with Docker
version: '3.7'
# Services
services:
# Nginx Service
nginx:
image: nginx:latest
ports:
- 80:80
volumes:
- ./:/var/www/php
- ./.docker/nginx/conf.d:/etc/nginx/conf.d
depends_on:
- php
# PHP Service
php:
image: php-fpm
build: ./.docker/php
working_dir: /var/www/php
volumes:
- ./:/var/www/php
depends_on:
- mysql
# MySQL Service
mysql:
image: mysql
ports:
- 3306:3306
volumes:
- ./.docker/mysql/my.cnf:/etc/mysql/conf.d/my.cnf
- ./.docker/mysqldata:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: toor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment