version: '2' services: db: image: mariadb volumes: - ./data/db/:/var/lib/mysql restart: always ports: - "3306:3306" environment: MYSQL_ROOT_PASSWORD: wproot MYSQL_DATABASE: wordpress MYSQL_USER: wpuser MYSQL_PASSWORD: wppass wordpress: depends_on: - db image: wordpress:latest ports: - "8080:80" restart: always environment: WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_USER: wpuser WORDPRESS_DB_PASSWORD: wppass working_dir: /var/www/html volumes: - ./data/wordpress:/var/www/html/wp-content