Skip to content

Commit e447651

Browse files
author
ironex
committed
Update commands, readme
1 parent 513eb65 commit e447651

File tree

11 files changed

+79
-55
lines changed

11 files changed

+79
-55
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,16 @@ Preferences - PHP - Servers
145145
- Accepts service name/s as argument/s in case you want to stop one or more specific services
146146
- ``` bin/docker/variables ```
147147
- This command is only used by other commands and it provides required variables for them, such as user and group id
148-
- ``` bin/helpers/cff ```
149-
- Removes frontend folder, and creates it again
150-
- ``` bin/helpers/cmf ```
151-
- Removes Magento folder, and creates it + other bind mounted folders
148+
- ``` bin/helpers/create-bind-mounted-folders```
149+
- Stops containers, checks if bind mounted folders specified in docker-compose.yml file exist and creates them if they don't
150+
- ``` bin/helpers/fix-filebeat-permissions ```
151+
- Filebeat container requires filebeat.yml to be only writtable by the owner
152+
- ``` bin/helpers/remove-frontend-folder ```
153+
- Stops containers and removes frontend folder
154+
- ``` bin/helpers/remove-magento-folder ```
155+
- Stops containers and removes Magento folder
152156
- ``` bin/new-project/magento ```
153-
- Creates new Magento project in magento folder
157+
- Creates new Magento project in Magento folder
154158
- ``` bin/new-project/vsf ```
155159
- Creates new VSF 2 project in frontend folder
156160
- ``` bin/composer ```
@@ -168,5 +172,5 @@ Preferences - PHP - Servers
168172

169173
- If elasticsearch container randomly stops working, then it is probably running out of RAM. Allocate more RAM to Docker Desktop and/or increase Xmx2g value specified in elasticsearch service configuration in docker-compose.yml and restart the container
170174
- You might encounter permission issues if you manually delete one of bind mounted folders, because docker will automatically recreate them with root permissions, which means, that your containers won't have write access to them, because all containers are running in rootless mode.
171-
- If filebeat container stops with the error below, then remove the container and run bin/helpers/ffp and then bin/docker/start
175+
- If filebeat container stops with the error below, then remove the container (or run bin/docker/cleanup to remove all containers and images) and run bin/helpers/fix-filebeat-permissions and then bin/docker/start
172176
- ```Exiting: error loading config file: config file ("filebeat.yml") can only be writable by the owner but the permissions are "-rw-rw-r--" (to fix the permissions use: 'chmod go-w /usr/share/filebeat/filebeat.yml')```

bin/helpers/cff

Lines changed: 0 additions & 14 deletions
This file was deleted.

bin/helpers/cmf

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/sh
2+
3+
echo "Stopping running containers"
4+
5+
# If containers with bind mounted folders are running, then deleted folders will be immediatelly re-created by Docker with root permissions
6+
bin/docker/stop
7+
8+
if [ ! -d "magento" ]
9+
then
10+
mkdir magento
11+
echo "Created magento folder"
12+
fi
13+
14+
if [ ! -d "magento/var" ]
15+
then
16+
mkdir magento/var
17+
echo "Created magento/var folder"
18+
fi
19+
20+
if [ ! -d "magento/var/log" ]
21+
then
22+
mkdir magento/var/log
23+
echo "Created magento/var/log folder"
24+
fi
25+
26+
if [ ! -d "magento/var/report" ]
27+
then
28+
mkdir magento/var/report
29+
echo "Created magento/var/report folder"
30+
fi
31+
32+
if [ ! -d "frontend" ]
33+
then
34+
mkdir frontend
35+
echo "Created frontend folder"
36+
fi

bin/helpers/ffp

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
# Filebeat container requires filebeat.yml to be only writtable by the owner
4+
5+
chmod 755 docker/filebeat/filebeat.yml

bin/helpers/remove-frontend-folder

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
echo "Stopping running containers"
4+
5+
# If containers with bind mounted folders are running, then deleted folders will be immediatelly re-created by Docker with root permissions
6+
bin/docker/stop
7+
8+
rm -rf frontend

bin/helpers/remove-magento-folder

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
# Remove Magento folder
4+
5+
echo "Stopping running containers"
6+
7+
# If containers with bind mounted folders are running, then deleted folders will be immediatelly re-created by Docker with root permissions
8+
bin/docker/stop
9+
10+
rm -rf magento

bin/new-project/magento

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ while true; do
1717
esac
1818
done
1919

20-
# Stop running containers
21-
bin/docker/stop
22-
2320
# Fix filebeat.yml permissions
24-
bin/helpers/ffp
21+
bin/helpers/fix-filebeat-permissions
22+
23+
# Remove Magento folder
24+
bin/helpers/remove-magento-folder
2525

26-
# Cleanup Magento folder
27-
bin/helpers/cmf
26+
# Create bind mounted folders
27+
bin/helpers/create-bind-mounted-folders
2828

2929
# Start containers
3030
bin/docker/start

bin/new-project/vsf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
. bin/docker/variables
44

5-
# Stop running containers
6-
bin/docker/stop
5+
# Remove Frontend folder
6+
bin/helpers/remove-frontend-folder
77

8-
# Cleanup frontend folder
9-
bin/helpers/cff
8+
# Create bind mounted folders
9+
bin/helpers/create-bind-mounted-folders
1010

1111
# Start containers
1212
bin/docker/start

0 commit comments

Comments
 (0)