skip to Main Content

I’ve found different ways to setup a local development environment for Shopware 6 but have so far only tried Dockware. The dev image has some tools which I find amazing like watch-admin and watch-storefront, but it should be used for plugin development and not full site. What is the "best" local Shopware 6 dev environment setup?

Could you include your docker-compose.yml when you use one?

4

Answers


  1. My vote goes to: ddev. Out of the box support of SW5/6, very good support (through discord or here on SO), good docs and very high customization.
    I’ve been using it for months now on Windows 10 + WSL and it’s been an absolute breeze to work with!

    Login or Signup to reply.
  2. Couldn’t agree more with https://stackoverflow.com/users/3329355/jim. Using ddev on Ubuntu for Shopware 5 and 6.

    This is my ddev/config.yaml for a simple Shopware 6 project:

    name: my-project
    type: shopware6
    docroot: public
    php_version: "8.0"
    webserver_type: apache-fpm
    router_http_port: "80"
    router_https_port: "443"
    xdebug_enabled: false
    additional_hostnames: []
    additional_fqdns: []
    mariadb_version: ""
    mysql_version: "8.0"
    use_dns_when_possible: true
    composer_version: ""
    web_environment:
     - APP_URL=http://${DDEV_SITENAME}.ddev.site
     - COMPOSER_MEMORY_LIMIT=-1
    

    Should you want to use the storefront and/or admin watcher, add a file docker-compose.watcher.yaml to your .ddev directory:

    version: "3.6"
    
    services:
        web:
            expose:
                # Storefront Hot Proxy Ports
                - 9997
                - 9998
                - 9999
            environment:
                # Shopware Administration Watch Host
                - HOST=0.0.0.0
                # Shopware Administration Watch Port
                - PORT=9997
                # Expose APP_URL to administration watcher
                - APP_URL=http://${DDEV_SITENAME}.ddev.site
                - HTTP_EXPOSE=${DDEV_ROUTER_HTTP_PORT}:80,${DDEV_MAILHOG_PORT}:8025,9999:9999,9998:9998,9997:9997
                - HTTPS_EXPOSE=${DDEV_ROUTER_HTTPS_PORT}:80,${DDEV_MAILHOG_HTTPS_PORT}:8025,8899:9999,8888:9998,8887:9997
    
    Login or Signup to reply.
  3. Dockware is working fine to me for Plugin dev and "full site". You can create your own image from templates: https://github.com/dockware/dockware/tree/master/.dist/versions/master/dev/6.4.12.0

    Login or Signup to reply.
  4. After a lot of flailing around we eventually used the shopware production repository as a template, we forked it. It seems to me that the development repository is focussed on plugin development only, not full projects. The watch admin and watch storefront features you mentioned exist on the production repository, they are shell scripts in the bin folder. We had to modify the images to get them into a workable state for us in a few ways:

    1. there were a few changes we needed to make for webpack watching and compiling to work:
      1. modify the docker compose template to listen to the ports webpack expected (8080/9998), we had to map them to different ports within docker so they wouldn’t clash with webpack (e.g. 8080 -> docker -> 8081)
      2. add an nginx config to proxy those requests to webpack again e.g. (8081 -> nginx -> 8080)
      3. use nginx to reset the Upgrade and Connection headers for websocket requests
    2. add a bunch of utilities to make working in the image easier (bash, npm, that sort of thing)
    3. I had to install composer programmatically as part of the build
    4. our optional project-specific stuff (we wanted rabbit for queues, we created docker images for working the queue and the task scheduler)

    We’ve not been working with this setup for long, but we are happy with it so far: we wanted to have development and production setups using the same repo, and minimally different docker setups, and this approach ticks all those boxes. I have to say we weren’t aware of dockware at the point of doing all this, but there are some advantages of doing things in house I guess.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search