Skip to main content

Running your first shop on docker

Background:

Docker is a subset of the bigger Moby Project, created in order to run multiple virtual machines via container system. 

"It is a software framework for building, running, and managing containers on servers and the cloud."- Opensource.com

What is a container?

If you have any experience in web development, you would be familiar with the concept of servers. Traditionally, servers have been hardware made to allow people to connect to websites. However, this system had its own flaws. Hardware dependency had to be reduced so the concept of containers was given. Containers are software based servers. They provide an added benefit since they are a hybrid of the relatively faster Linux OS and a hyper-localized runtime environment.

How to run your first Shopware shop on Docker?

Running your demo-store (or Demo-shop) on docker is quite easy. Let us show you how to perform this task step by step:

My Setup:

For this tutorial, I will be using:

1. Windows 10 pro

2. Docker Desktop

3. Git Bash

Pre- Requisites:

In order to follow through this tutorial, you are expected to have the following stuff done:

1. Install docker for windows

2. Install git and git bash

Step 1: Open Git Bash

In the folder where you want your shopware files to be stored, right click and click on "Git Bash Here" option:


You will see something like this open up:


Once this screen opens up, this step is complete.

Step 2: Check if docker is installed 

Just like any other software, the simplest way to check whether your docker is installed it to check its version through the version command. In your git bash, type the following command:

docker --version


If your docker is installed correctly on your system, you should be able to see something like this:


If this worked fine, you can move on to the next step:

Step 3: Run command to build shop

Now that you have your docker version, its time to run the final command. I will be showing a breakdown of this command so that you may customize it as per your need. The command is:

"docker run --rm -p 80:80 dockware/dev:latest"

In this command, some parts are fixed and others can be changed as per your need.

1. docker run: This one is mandatory to run any docker container via git bash.

2. --rm: This is to allow a fresh start. This part will remove all previous containers working for this. 

3. -p: This is mandatory to link the port of your local system to the port of the docker container.

4. 80:80: These two are default ports and you can change them as per your available ports. The first (one before colon) is your host port (or ip) which is basically the port of your local system. The one after colon is the port of your docker container. 

5. dockware/dev:latest: This part is mandatory to define the version of shopware you want to run. In this case, we want to run the lastest shopware. however, if you want to run some other version, just replace the "latest" with the respective version. For example: docker run --rm 300:80 dockware/dev:6.3.4.3

*Note: This method is good when you want to run shopware for the first time. If you want to re-run it after doing it once, just open docker-desktop and start the relevant container:


The container is already created automatically after your first run.

Step 4: Check localhost

Open localhost (with the relevant port, if needed). If everything went fine and the container shows running, you should be able to see your first shopware shop with the title Demostore. Just make sure you wait for a while after running the command since building a container (or even running an already built container) might take some time. Your display should be something like this:


Of course, the page is different since this is the Clothing page not the Home page. But the overall look should be similar. 

If you want to check out some plugins, you can check my github. So this is how you set up your first Shopware shop through docker. Now its your turn to experiment. Best of luck. Your feedback is highly appreciated. For suggestions, comments and queries, send me an email on hasanhere11@gmail.com. Cheers!!

Comments

Popular posts from this blog

The power and potential of Shopware

What is Shopware? Shopware is an opensource ecommerce platform.  Why Shopware? Shopware has 3 outstanding features: 1. Open Commerce Platform. 2. Business Model Composer. 3. Composable Customer Experience. Open Commerce Platform: Shopware is an open source platform which means that you completely own the shop and the source code that comes with it. You can hire your own developers to have customizations done to any level and all of those customizations would be completely yours. Business Model Composer: No matter what your business model is, Shopware can  build a platform for you. From digital services and product-based shops to highly professional online learning academy, Shopware makes it all possible. This adaptability comes from the platform's open commerce functionality. Without the need for writing a code, you can get the best storefront and admin panel facilities that suit your business needs. Composable Customer Experience: As a user, you would want your shop to maintain yo

How to build your custom component in Shopware 6?

What are components? As the name suggests, components are little pieces of the bigger puzzle (that is your website). They are one of the best implementations of the decoupling concept of object oriented programming in a website. Each component serves a single purpose (ideally) and when called, you can see that functionality being performed. The portability of the components is what makes them so interesting. I could create a component that says "Hello World!" and I could call it in multiple places throughout my website and I would see the message "Hello World!" displayed wherever it is called. Just imagine the possibilities that are there if the components are implemented in your website. The basic purpose is to prevent the need for rewriting a certain functionality (eg, a datepicker with certain properties and styling). Just create a component once and call it wherever you need.  How are components created? For every platform and technology, the method might vary.