version: '3.1'

services:

   db:
     image: mysql:5.7
     volumes:
       - ~/wp/db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: password
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: wordpress
       
   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     volumes:
       - ~/wp/wp_site:/var/www/html
       - ~/wp/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
     ports:
       - "80:80"
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_USER: wordpress
       WORDPRESS_DB_PASSWORD: wordpress
