You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -13,213 +13,41 @@ With the help of Docker Compose, you can define containers to be built, their co
13
13
It is recommended to keep your application files and database data volume on the Docker host and mount them on the running container. This ensures that the application and database data persistence even in the case of containers' failure or termination. In this way, even if you destroy containers, your data won't get lost unless you remove them forcefully.
14
14
This compose configuration file mounts the application directory **`app`** and database volume **`dbvolume`** from the host to running Docker containers at the time of containers' launch.
15
15
16
-
##Installation & Setup
16
+
### Docker Setup for Bagisto
17
17
18
-
### First steps
18
+
You can configure Bagisto using Docker in two different ways:
19
19
20
-
Before you can launch Bagisto in a Docker environment, you need to install the latest versions of Docker and Docker Compose.
Both approaches allow you to set up the application quickly, managing all system requirements like Apache, MySQL, and PHPMyAdmin within isolated containers. Below is a detailed guide for each method.
25
23
26
-
### Configure the Docker container
24
+
### **Using Bagisto Docker Image from Docker Hub**
27
25
28
-
Once Docker and Docker Compose are installed, you need to create a **`docker-compose.yml`** file. The **`docker-compose.yml`** configuration file requires the following inputs from the user:
26
+
Follow the steps below to set up Bagisto using Docker Hub. This approach provides a pre-configured Docker image of Bagisto, allowing for a quick and easy installation.
29
27
30
-
#### Webserver configuration
28
+
#### Step 1: Pull Bagisto Docker Image
31
29
32
-
In the **`web_server`** service block, assign your system's working user UID to the **`USER_UID`** environment variable. To find your user ID, run the following command on Linux or macOS:
33
-
```shell
34
-
id -u
35
-
```
36
-
37
-
#### Database configuration
38
-
39
-
In the **`database_server`** service block, assign the MySQL database name, MySQL database user name, MySQL database user password, and MySQL root password to the **`MYSQL_DATABASE`**, **`MYSQL_USER`**, **`MYSQL_PASSWORD`**, and **`MYSQL_ROOT_PASSWORD`** environment variables, respectively.
40
-
41
-
#### Clone configuration from GitHub
42
-
43
-
You can make use of our repository from GitHub by cloning it into your new directory:
Alternatively, you can create a new folder, for example, **`bagisto-docker`**, and manually create the **`docker-compose.yml`** file inside it. Add the following content to **`docker-compose.yml`**:
51
-
52
-
```yml
53
-
version: '3'
54
-
55
-
services:
56
-
57
-
web_server:
58
-
image: webkul/apache-php:latest
59
-
container_name: apache2
60
-
restart: always
61
-
volumes:
62
-
- ./app:/var/www/html
63
-
working_dir: /var/www/html/
64
-
environment:
65
-
USER_UID: 'mention your system user ID here. ex: 1001, 1000, 33, etc'
66
-
networks:
67
-
- bagisto-network
68
-
ports:
69
-
- '80:80'
70
-
expose:
71
-
- '80'
72
-
depends_on:
73
-
- database_server
74
-
links:
75
-
- database_server
76
-
77
-
database_server:
78
-
image: mysql:5.7
79
-
container_name: mysql
80
-
restart: always
81
-
environment:
82
-
MYSQL_DATABASE: 'mention the name of the database to be created here. eg: mydatabase'
83
-
MYSQL_USER: 'mention database user here. eg: mydatabase_user'
84
-
MYSQL_PASSWORD: 'mention database user password here. ex: mystrongPassword'
85
-
MYSQL_ROOT_PASSWORD: 'mention mysql root password here. ex: mysqlstrongpass'
86
-
MYSQL_ROOT_HOST: '%'
87
-
networks:
88
-
- bagisto-network
89
-
ports:
90
-
- '3306:3306'
91
-
expose:
92
-
- '3306'
93
-
volumes:
94
-
- ./dbvolume:/var/lib/mysql
95
-
96
-
volumes:
97
-
dbvolume:
98
-
app:
99
-
100
-
networks:
101
-
bagisto-network:
102
-
**
103
-
```
104
-
105
-
#### Downloading the Docker Image
106
-
107
-
To download the Docker images for Apache-PHP version 7.3 and MySQL version 5.7, execute the following command:
108
-
109
-
```shell
110
-
docker-compose pull
111
-
```
112
-
113
-
### Launching the Docker Container
114
-
115
-
Execute the following command to create a network and launch web server and database containers with the names **`apache2`** and **`mysql`** respectively. It will also create new directories **`app`** and **`dbvolume`** within your current directory and mount them to the respective Docker containers as specified in the **`docker-compose.yml`** file. Additionally, it binds your **`host port 80`** to the Apache2 container's port 80, and your **`host port 3306`** to the MySQL container's port 3306. If you wish to use different ports for the containers, modify their values in the **`docker-compose.yml`** file.
116
-
117
-
```
118
-
docker-compose up -d
119
-
```
120
-
121
-
### Monitoring Your Container(s)
122
-
123
-
To check the running Docker containers, use the following commands:
124
-
125
-
**`docker ps`** OR **`docker-compose ps`**
126
-
```shell
127
-
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
128
-
62a10346b84a webkul/apache-php:latest "/usr/bin/supervisord" About an hour ago Up About an hour 0.0.0.0:80->80/tcp apache2
129
-
90a0a2e0e46b mysql:5.7 "docker-entrypoint.s…" About an hour ago Up About an hour 0.0.0.0:3306->3306/tcp, 33060/tcp mysql
130
-
```
131
-
132
-
## Configuring Bagisto
30
+
To pull the Bagisto Docker image from Docker Hub, use the following command:
133
31
134
-
After setting up your environment, you can proceed with the installation of Bagisto. There are two ways to install Bagisto: either from [Github](#install-without-composer) or using [composer](#install-with-composer).
135
-
136
-
### Install without Composer
137
-
138
-
To install Bagisto without using composer, follow these steps:
139
-
1. Download the [latest release](https://bagisto.com/en/download) and save it in the **`app/bagisto`** directory.
140
-
2. Open the **`.env`** file located inside the **app/bagisto** directory.
141
-
3. Set the following environment variables as shown below:
Bagisto has been successfully installed and is now ready to use. To access it, open your web browser and enter your server's IP address or domain name.
36
+
#### Step 2: Run a New Container
195
37
196
-
### Configuring Apache
38
+
Once the image is pulled, you can run a new Docker container using the command below. This will bind your local port 80 to the container’s port 80, so Bagisto can be accessed via the browser.
197
39
198
-
By default, the Apache document root is set to **/var/www/html/public_html**. Additionally, the **app** directory on your host machine is mapped to the **html** directory inside the container. To ensure proper configuration, we need to create a symlink of **`bagisto/public`** in the **`app`** directory that points to **`/var/www/html/public_html`**.
199
-
200
-
To create the symlink, follow the steps below:
201
-
202
-
On Linux or macOS, run the following command:
203
40
```bash
204
-
cd app; ln -snf bagisto/public public_html
41
+
docker run -it -d -p 80:80 webkul/bagisto:1.5.1
205
42
```
206
43
207
-
On Windows, run the following command:
208
-
```command-line
209
-
cd app
210
-
mklink bagisto/public public_html
211
-
```
212
-
213
-
### Ready to Use
214
-
215
-
#### Admin Login:
44
+
#### Step 3: Access Bagisto in Your Browser
216
45
217
-
You can access the admin interface by visiting [http://your_server_endpoint/admin](http://your_server_endpoint/admin/) and logging in with the following credentials:
46
+
After the container is up and running, open your browser and navigate to `http://localhost`. This will load the Bagisto setup.
218
47
219
-
| Email | Password |
220
-
|----------------------|----------|
221
-
|admin@example.com| admin123 |
48
+
#### Step 4: Admin Login Credentials
222
49
223
-
#### Customer Login:
50
+
Use the following credentials to log in to the Bagisto admin panel:
224
51
225
-
To access your store, visit [http://your_server_endpoint/](http://your_server_endpoint/).
0 commit comments