File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,10 @@ This directory contains the Docker configuration for running the WebMall e-comme
15
15
Create a ` .env ` file in the parent directory (one level up from this ` docker_all ` folder):
16
16
17
17
``` bash
18
- # Copy the example file
18
+ # Copy the example env file from the docker_all dir
19
19
cp ../.env.example ../.env
20
+ # Copy the example env file from the root dir
21
+ cp .env.example .env
20
22
```
21
23
Set the SHOP_PORT variable as desired.
22
24
@@ -26,7 +28,7 @@ Set the SHOP_PORT variable as desired.
26
28
27
29
``` bash
28
30
cd docker_all
29
- ./restore_all_and_deploy_local.sh
31
+ bash ./restore_all_and_deploy_local.sh
30
32
```
31
33
32
34
This script will:
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Check if the port is provided as an argument
4
+ if [ -z " $1 " ]; then
5
+ echo " Error: No port provided. Please specify the port as the first argument."
6
+ exit 1
7
+ fi
8
+
9
+ # Assign the port passed as an argument to the PORT variable
10
+ PORT=$1
11
+
12
+ # Perform search-replace on the URLs
13
+ # WARNING!: This search is not looking for exactly this string, so http://localhost:XXXX gets turned to http://localhost:XXXX:XXXX
14
+ wp search-replace ' http://localhost' " http://localhost:${PORT} " --all-tables --path=/opt/bitnami/wordpress
15
+
16
+ # Clear the cache
17
+ wp cache flush --path=/opt/bitnami/wordpress
18
+
19
+ echo " URLs updated to port ${PORT} "
20
+
You can’t perform that action at this time.
0 commit comments