Skip to content

Stadesign/ShopwareDocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shopware Docker

This Docker image collection provides a ready-to-go solution for Shopware. It's based on nginx, php-fpm, MariaDB, ElasticSearch and Varnish. Furthermore, it provides a simple SCP-Server for up-/downloading files.

Structure

structure

Using it

Setup

Just edit the live.env-file, check the docker-compose.yml and run:

docker-compose up -d

The images will be built.

When the machines are booted, run the Shopware installation script:

docker exec -it sw-admin installSW

This will download and install Shopware. Furthermore, the plugins defined in the STORE_ADDONS within the docker-compose.yml-file will be downloaded and activated. The plugins defined in the INSTALL_ADDONS-section will be installed.

If you are going to put your Shopware instance behind an https-secured reverse-proxy, uncomment the line

#fastcgi_param  HTTPS 'on';

in the file build/nginx/config/default.conf. This will tell Shopware to use HTTPS URLs for images, scripts, etc..

Finally, the shopware-instance will be found at http://localhost:8080. The backend will be at http://localhost:8080/backend where you can login with the credentials demo/demo.

A SCP-Connection can be established to localhost:2222 using the credentials defined in the docker-compose.yml.

the sw-admin machine

The docker-container sw-admin contains shopware's cli tool console. You can run the commands via your cli by calling:

docker exec -it sw-admin console

Example Scenario: You want to download and install Shopware's Demo Data. Just run this commands:

docker exec -it sw-admin console sw:store:download SwagDemoDataDE
docker exec -it sw-admin console sw:plugin:install --activate SwagDemoDataDE

The sw-admin-container might also be the point for running backups.

cronjobs

You can alter the crontab for the sw-admin machine in this file: build/sw-admin/cronjobs.

Troubleshooting

If the categories are empty, just run

docker exec -it sw-admin console sw:es:index:populate

This will populate the elasticsearch index and the categories are filled with products.

Possible improvements

You might want to run all the machines within an VPN or virtual network and only forward the needed ports to the public. Maybe a reverse-proxy docker is also a good idea.

Help wanted / needed

If you have any ideas and improvements or questions to commit, feel free to do so :).