We start by preparing our environment. To develop new plugins, themes and features, in the most efficient way, we recommend a few things.
Docker Compose This helps you to create a good architecture and blue prints of your setup.
IDE with SFTP upload We recommend PhpStorm ❤️ It's just so good...and it also has automatic uploads.
Chrome XDebug Extension Dockware comes with plug'n'play XDebug. All you need is this extension to enable it in your browser.
1. Start Docker
Alright, we're ready to start our development container. You need 2 basic things for this.
docker-compose.yml (template below)
a few commands plain or in makefile (below)
We recommend creating a new folder for your project that contains your docker files.
Use this template file to get started. It already comes with all ports you might need and volume mounting for both the database and the DocRoot of Shopware. You can decide to either use the prepared "dev" image with a ready to use Shopware, or use the new "essentials" image that provides you a full environment without an installed Shopware. (see instructions below) docker-compose.yml
version: "3"services:shopware:image: dockware/dev:latestcontainer_name: shopwareports:- "80:80"- "3306:3306"- "22:22"- "8888:8888"- "9999:9999"- "9998:9998"networks:- webenvironment:- XDEBUG_ENABLED=1networks:web:external: false
Now open your terminal, navigate to the directory with your docker-compose.yml and run this command:
docker-compose up -d
2. Prepare Development
Great, you should now have a running Shopware 6 on your local machine. The prepared application environment is DEV and should already contain everything you need. You can immediately access the database with the exposed port 3306 (see FAQ for more).
Now it's time to download the current version of Shopware to your host. This is required to have code completion and IntelliSense right in your IDE, and thus we need it.
mkdir -p ./srcdocker cp shopware:/var/www/html/. ./src
3. Prepare IDE
Only if you wan't to use sftp, otherwise see our bind-mouting docs. Open the src folder with your preferred IDE and wait until finished loading. Then add a new SFTP connection to your container. We recommend Automatic-Upload if possible. If you need the SSH/SFTP credentials, please see the FAQ section for details.
If you have PhpStorm, we also recommend enabling the Symfony Plugin for better code completion.
4. Sample Plugin
To get you started as fast as possible, we've already prepared a Dockware Sample Plugin which is already installed and active. So you can start right from this plugin with your experiments in Shopware 6....or create your own plugin.