shyim/shopware

By shyim

Updated 4 days ago

Image
14

1M+

What is Shopware?

Shopware is a trendsetting ecommerce platform to power your online business. Our ecommerce solution offers the perfect combination of beauty & brains you need to build and customize a fully responsive online store.

Shopware Logo

How to use this image

To run Shopware 6 you will need a compatible MySQL or MariaDB container.

Smallest example with docker-compose

version: "3.8"
services:
  mysql:
    image: mysql:8.0
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: shopware
      MYSQL_USER: shopware
      MYSQL_PASSWORD: shopware
  shopware:
    image: shyim/shopware:6.4.20-php8.2
    environment:
      APP_SECRET: 440dec3766de53010c5ccf6231c182acfc90bd25cff82e771245f736fd276518
      INSTANCE_ID: 10612e3916e153dd3447850e944a03fabe89440970295447a30a75b151bd844e
      APP_URL: http://localhost
      BLUE_GREEN_DEPLOYMENT: 0
      DATABASE_HOST: mysql
      DATABASE_URL: mysql://shopware:shopware@mysql:3306/shopware
    ports:
      - 80:80

Try

The installation will be accessible at http://localhost. The default credentials for the administration are admin and shopware as password.

Following environment can be set:

VariableDefault ValueDescription
APP_ENVprodEnvironment
APP_SECRET(empty)Can be generated with openssl rand -hex 32
APP_URL(empty)Where Shopware will be accessible
INSTANCE_ID(empty)Unique Identifier for the Store: Can be generated with openssl rand -hex 32
DATABASE_HOST(empty)Host of MySQL (needed for for checking is MySQL alive)
DATABASE_URL(empty)MySQL credentials as DSN
MAILER_URLnull://localhostMailer DSN (Admin Configuration overwrites this)
SHOPWARE_ES_HOSTS(empty)Elasticsearch Hosts
SHOPWARE_ES_ENABLED0Elasticsearch Support Enabled?
SHOPWARE_ES_INDEXING_ENABLED0Elasticsearch Indexing Enabled?
SHOPWARE_ES_INDEX_PREFIX(empty)Elasticsearch Index Prefix
COMPOSER_HOME/tmp/composerCaching for the Plugin Manager
SHOPWARE_HTTP_CACHE_ENABLED1Is HTTP Cache enabled?
SHOPWARE_HTTP_DEFAULT_TTL7200Default TTL for Http Cache
DISABLE_ADMIN_WORKERfalseDisables the admin worker
INSTALL_LOCALEen-GBDefault locale for the Shop
INSTALL_CURRENCYEURDefault currency for the Shop
INSTALL_ADMIN_USERNAMEadminDefault admin username
INSTALL_ADMIN_PASSWORDshopwareDefault admin password
CACHE_ADAPTERdefaultSet this to redis to enable redis caching
REDIS_CACHE_HOSTredisHost for redis caching
REDIS_CACHE_PORT6379Redis cache port
REDIS_CACHE_DATABASE0Redis database index
SESSION_ADAPTERdefaultSet this to redis to enable redis session adapter
REDIS_SESSION_HOSTredisHost for redis session
REDIS_SESSION_PORT6379Redis session port
REDIS_SESSION_DATABASE0Redis session index
ACTIVE_PLUGINS(empty)A list of plugins which should be installed and updated
TZEurope/BerlinPHP default timezone
PHP_MAX_UPLOAD_SIZE128mSee php documentation
PHP_MAX_EXECUTION_TIME300See php documentation
PHP_MEMORY_LIMIT512mSee php documentation
FPM_PMdynamicSee php fpm documentation
FPM_PM_MAX_CHILDREN5See php fpm documentation
FPM_PM_START_SERVERS2See php fpm documentation
FPM_PM_MIN_SPARE_SERVERS1See php fpm documentation
FPM_PM_MAX_SPARE_SERVERS3See php fpm documentation

When Shopware with SSL behind a reverse proxy such as NGINX which is responsible for doing TLS termination, be sure configure Trusted Headers.

Updates

When you update the image version, automatically all required migrations will run. Downgrade works in a similar way. Please check before here the Blue-Green compatibility of Shopware.

Running multiple containers

See docker-compose-advanced.yml for a full docker-compose example.

Mode: default

  • The container will check is Shopware installed and install or update it (and execute hooks).
  • Will start Web server
command: ['default']

Mode: web

  • Will start Web server
command: ['web']

Mode: maintenance

  • The container will check is Shopware installed and install or update it (and execute hooks).
command: ['maintenance']

Mode: cli

  • Allows to run cli commands like message consumer and other tasks
command: ['cli', 'symfony:command', 'arg1', 'arg2']

Volumes

PathDescription
/stateContains state about current installed version.
/var/www/html/custom/pluginsInstalled plugins
/var/www/html/filesDocuments and other private files
/var/www/html/var/logLogs
/var/www/html/public/themeCompiled theme files
/var/www/html/public/mediaUploaded files
/var/www/html/public/bundlesBundle Assets
/var/www/html/public/sitemapSitemap
/var/www/html/public/thumbnailGenerated Thumbnails
/var/www/html/config/jwtJWT Certificate for API

Extending the image

Additional hooks

  • To run script on installation, add a new file to /etc/shopware/scripts/on-install/xx.sh
  • To run script on update, add a new file to /etc/shopware/scripts/on-update/xx.sh
  • To run script on startup, add a new file to /etc/shopware/scripts/on-startup/xx.sh

Install plugins from packages.friendsofshopware.com

FROM shyim/shopware:6.2.0

# Add repository
RUN jq '.repositories += [{"type": "composer","url": "https://packages.friendsofshopware.com/","options": {"http": {"header": ["Token: MyToken"]}}}]' /var/www/html/composer.json > /var/www/html/composer2.json && \
  cp composer2.json composer.json && \
  chown 1000:1000 composer.json

RUN sudo -u www-data composer require store.shopware.com/swagcmsextensions

Docker Pull Command

docker pull shyim/shopware