mirror of
https://github.com/cytopia/devilbox.git
synced 2024-12-18 20:37:55 +00:00
Enable new autostart behaviour: per version and for all
This commit is contained in:
parent
f2b0773fb5
commit
ccd3f1dbc2
1
.gitignore
vendored
1
.gitignore
vendored
@ -83,6 +83,7 @@
|
||||
/cfg/php-fpm-7.4/*.conf
|
||||
|
||||
# Ignore custom PHP-FPM startup scripts
|
||||
/autostart/*.sh
|
||||
/cfg/php-startup-5.2/*.sh
|
||||
/cfg/php-startup-5.3/*.sh
|
||||
/cfg/php-startup-5.4/*.sh
|
||||
|
@ -9,7 +9,7 @@ COMPOSEPATH="${SCRIPTPATH}/../../"
|
||||
CONTAINER="$( cd "${COMPOSEPATH}" && docker-compose ps -q php )"
|
||||
|
||||
#FILES="$()"
|
||||
cd "${COMPOSEPATH}" && docker-compose exec -T php bash -c "find /startup.d/*.sh-example -type f -print0 2>/dev/null" \
|
||||
cd "${COMPOSEPATH}" && docker-compose exec -T php bash -c "find /startup.1.d/*.sh-example -type f -print0 2>/dev/null" \
|
||||
| xargs -0 -n 1 echo \
|
||||
| while read f; do
|
||||
|
38
.tests/startup-tests/startup.2.sh
Executable file
38
.tests/startup-tests/startup.2.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -u
|
||||
set -o pipefail
|
||||
|
||||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
|
||||
COMPOSEPATH="${SCRIPTPATH}/../../"
|
||||
CONTAINER="$( cd "${COMPOSEPATH}" && docker-compose ps -q php )"
|
||||
|
||||
#FILES="$()"
|
||||
cd "${COMPOSEPATH}" && docker-compose exec -T php bash -c "find /startup.2.d/*.sh-example -type f -print0 2>/dev/null" \
|
||||
| xargs -0 -n 1 echo \
|
||||
| while read f; do
|
||||
|
||||
echo "# ----------------------------------------------------------------------------------------"
|
||||
echo "# [TEST] ${f}"
|
||||
echo "# ----------------------------------------------------------------------------------------"
|
||||
if ! docker exec -t ${CONTAINER} bash "${f}" "ACCEPT_EULA=1"; then
|
||||
sleep 5
|
||||
if ! docker exec -t ${CONTAINER} bash "${f}" "ACCEPT_EULA=1"; then
|
||||
sleep 5
|
||||
if ! docker exec -t ${CONTAINER} bash "${f}" "ACCEPT_EULA=1"; then
|
||||
sleep 5
|
||||
if ! docker exec -t ${CONTAINER} bash "${f}" "ACCEPT_EULA=1"; then
|
||||
sleep 5
|
||||
if ! docker exec -t ${CONTAINER} bash "${f}" "ACCEPT_EULA=1"; then
|
||||
echo "[FAIl] ${f}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
echo "[OK] ${f}"
|
||||
echo
|
||||
echo
|
||||
done
|
29
autostart/README.md
Normal file
29
autostart/README.md
Normal file
@ -0,0 +1,29 @@
|
||||
# Custom startup scripts (global)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
the user to accept a license or similar.
|
||||
|
||||
A few examples are given that do not end by `.sh` which won't be run. If you want to use the
|
||||
provided examples, copy them to a file ending by `.sh`
|
||||
|
||||
|
||||
## Info
|
||||
|
||||
If you want to autostart NodeJS applications, you can use [pm2](https://github.com/Unitech/pm2).
|
||||
Ensure you do this as user `devilbox`, as by default everything is run by root.
|
||||
|
||||
```bash
|
||||
su -c 'cd /shared/httpd/node/node; pm2 start index.js' -l devilbox
|
||||
```
|
||||
|
||||
|
||||
## Note
|
||||
|
||||
This directory will startup commands for all PHP versions. If you want to selectively run commands
|
||||
for a specific version, go to `cfg/php-startup-X.Y/`.
|
||||
|
||||
|
||||
## Important
|
||||
|
||||
All provided scripts will be executed with **root** permissions.
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts
|
||||
# Custom startup scripts (per PHP version)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
@ -8,6 +8,22 @@ A few examples are given that do not end by `.sh` which won't be run. If you wan
|
||||
provided examples, copy them to a file ending by `.sh`
|
||||
|
||||
|
||||
## Info
|
||||
|
||||
If you want to autostart NodeJS applications, you can use [pm2](https://github.com/Unitech/pm2).
|
||||
Ensure you do this as user `devilbox`, as by default everything is run by root.
|
||||
|
||||
```bash
|
||||
su -c 'cd /shared/httpd/node/node; pm2 start index.js' -l devilbox
|
||||
```
|
||||
|
||||
|
||||
## Note
|
||||
|
||||
This directory will startup commands only for a specific PHP version. If you want to run commands
|
||||
for all versions , go to `autostart/` in the root of the Devilbox git directory.
|
||||
|
||||
|
||||
## Important
|
||||
|
||||
All provided scripts will be executed with **root** permissions.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts
|
||||
# Custom startup scripts (per PHP version)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
@ -8,6 +8,22 @@ A few examples are given that do not end by `.sh` which won't be run. If you wan
|
||||
provided examples, copy them to a file ending by `.sh`
|
||||
|
||||
|
||||
## Info
|
||||
|
||||
If you want to autostart NodeJS applications, you can use [pm2](https://github.com/Unitech/pm2).
|
||||
Ensure you do this as user `devilbox`, as by default everything is run by root.
|
||||
|
||||
```bash
|
||||
su -c 'cd /shared/httpd/node/node; pm2 start index.js' -l devilbox
|
||||
```
|
||||
|
||||
|
||||
## Note
|
||||
|
||||
This directory will startup commands only for a specific PHP version. If you want to run commands
|
||||
for all versions , go to `autostart/` in the root of the Devilbox git directory.
|
||||
|
||||
|
||||
## Important
|
||||
|
||||
All provided scripts will be executed with **root** permissions.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts
|
||||
# Custom startup scripts (per PHP version)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
@ -8,6 +8,22 @@ A few examples are given that do not end by `.sh` which won't be run. If you wan
|
||||
provided examples, copy them to a file ending by `.sh`
|
||||
|
||||
|
||||
## Info
|
||||
|
||||
If you want to autostart NodeJS applications, you can use [pm2](https://github.com/Unitech/pm2).
|
||||
Ensure you do this as user `devilbox`, as by default everything is run by root.
|
||||
|
||||
```bash
|
||||
su -c 'cd /shared/httpd/node/node; pm2 start index.js' -l devilbox
|
||||
```
|
||||
|
||||
|
||||
## Note
|
||||
|
||||
This directory will startup commands only for a specific PHP version. If you want to run commands
|
||||
for all versions , go to `autostart/` in the root of the Devilbox git directory.
|
||||
|
||||
|
||||
## Important
|
||||
|
||||
All provided scripts will be executed with **root** permissions.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts
|
||||
# Custom startup scripts (per PHP version)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
@ -8,6 +8,22 @@ A few examples are given that do not end by `.sh` which won't be run. If you wan
|
||||
provided examples, copy them to a file ending by `.sh`
|
||||
|
||||
|
||||
## Info
|
||||
|
||||
If you want to autostart NodeJS applications, you can use [pm2](https://github.com/Unitech/pm2).
|
||||
Ensure you do this as user `devilbox`, as by default everything is run by root.
|
||||
|
||||
```bash
|
||||
su -c 'cd /shared/httpd/node/node; pm2 start index.js' -l devilbox
|
||||
```
|
||||
|
||||
|
||||
## Note
|
||||
|
||||
This directory will startup commands only for a specific PHP version. If you want to run commands
|
||||
for all versions , go to `autostart/` in the root of the Devilbox git directory.
|
||||
|
||||
|
||||
## Important
|
||||
|
||||
All provided scripts will be executed with **root** permissions.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts
|
||||
# Custom startup scripts (per PHP version)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
@ -8,6 +8,22 @@ A few examples are given that do not end by `.sh` which won't be run. If you wan
|
||||
provided examples, copy them to a file ending by `.sh`
|
||||
|
||||
|
||||
## Info
|
||||
|
||||
If you want to autostart NodeJS applications, you can use [pm2](https://github.com/Unitech/pm2).
|
||||
Ensure you do this as user `devilbox`, as by default everything is run by root.
|
||||
|
||||
```bash
|
||||
su -c 'cd /shared/httpd/node/node; pm2 start index.js' -l devilbox
|
||||
```
|
||||
|
||||
|
||||
## Note
|
||||
|
||||
This directory will startup commands only for a specific PHP version. If you want to run commands
|
||||
for all versions , go to `autostart/` in the root of the Devilbox git directory.
|
||||
|
||||
|
||||
## Important
|
||||
|
||||
All provided scripts will be executed with **root** permissions.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts
|
||||
# Custom startup scripts (per PHP version)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
@ -8,6 +8,22 @@ A few examples are given that do not end by `.sh` which won't be run. If you wan
|
||||
provided examples, copy them to a file ending by `.sh`
|
||||
|
||||
|
||||
## Info
|
||||
|
||||
If you want to autostart NodeJS applications, you can use [pm2](https://github.com/Unitech/pm2).
|
||||
Ensure you do this as user `devilbox`, as by default everything is run by root.
|
||||
|
||||
```bash
|
||||
su -c 'cd /shared/httpd/node/node; pm2 start index.js' -l devilbox
|
||||
```
|
||||
|
||||
|
||||
## Note
|
||||
|
||||
This directory will startup commands only for a specific PHP version. If you want to run commands
|
||||
for all versions , go to `autostart/` in the root of the Devilbox git directory.
|
||||
|
||||
|
||||
## Important
|
||||
|
||||
All provided scripts will be executed with **root** permissions.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts
|
||||
# Custom startup scripts (per PHP version)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
@ -8,6 +8,22 @@ A few examples are given that do not end by `.sh` which won't be run. If you wan
|
||||
provided examples, copy them to a file ending by `.sh`
|
||||
|
||||
|
||||
## Info
|
||||
|
||||
If you want to autostart NodeJS applications, you can use [pm2](https://github.com/Unitech/pm2).
|
||||
Ensure you do this as user `devilbox`, as by default everything is run by root.
|
||||
|
||||
```bash
|
||||
su -c 'cd /shared/httpd/node/node; pm2 start index.js' -l devilbox
|
||||
```
|
||||
|
||||
|
||||
## Note
|
||||
|
||||
This directory will startup commands only for a specific PHP version. If you want to run commands
|
||||
for all versions , go to `autostart/` in the root of the Devilbox git directory.
|
||||
|
||||
|
||||
## Important
|
||||
|
||||
All provided scripts will be executed with **root** permissions.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts
|
||||
# Custom startup scripts (per PHP version)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
@ -8,6 +8,22 @@ A few examples are given that do not end by `.sh` which won't be run. If you wan
|
||||
provided examples, copy them to a file ending by `.sh`
|
||||
|
||||
|
||||
## Info
|
||||
|
||||
If you want to autostart NodeJS applications, you can use [pm2](https://github.com/Unitech/pm2).
|
||||
Ensure you do this as user `devilbox`, as by default everything is run by root.
|
||||
|
||||
```bash
|
||||
su -c 'cd /shared/httpd/node/node; pm2 start index.js' -l devilbox
|
||||
```
|
||||
|
||||
|
||||
## Note
|
||||
|
||||
This directory will startup commands only for a specific PHP version. If you want to run commands
|
||||
for all versions , go to `autostart/` in the root of the Devilbox git directory.
|
||||
|
||||
|
||||
## Important
|
||||
|
||||
All provided scripts will be executed with **root** permissions.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts
|
||||
# Custom startup scripts (per PHP version)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
@ -8,6 +8,22 @@ A few examples are given that do not end by `.sh` which won't be run. If you wan
|
||||
provided examples, copy them to a file ending by `.sh`
|
||||
|
||||
|
||||
## Info
|
||||
|
||||
If you want to autostart NodeJS applications, you can use [pm2](https://github.com/Unitech/pm2).
|
||||
Ensure you do this as user `devilbox`, as by default everything is run by root.
|
||||
|
||||
```bash
|
||||
su -c 'cd /shared/httpd/node/node; pm2 start index.js' -l devilbox
|
||||
```
|
||||
|
||||
|
||||
## Note
|
||||
|
||||
This directory will startup commands only for a specific PHP version. If you want to run commands
|
||||
for all versions , go to `autostart/` in the root of the Devilbox git directory.
|
||||
|
||||
|
||||
## Important
|
||||
|
||||
All provided scripts will be executed with **root** permissions.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom startup scripts
|
||||
# Custom startup scripts (per PHP version)
|
||||
|
||||
Any script inside this directory ending by `.sh` will be executed during the PHP container startup.
|
||||
This is useful to apply your custom settings such as installing software that usually requires
|
||||
@ -8,6 +8,22 @@ A few examples are given that do not end by `.sh` which won't be run. If you wan
|
||||
provided examples, copy them to a file ending by `.sh`
|
||||
|
||||
|
||||
## Info
|
||||
|
||||
If you want to autostart NodeJS applications, you can use [pm2](https://github.com/Unitech/pm2).
|
||||
Ensure you do this as user `devilbox`, as by default everything is run by root.
|
||||
|
||||
```bash
|
||||
su -c 'cd /shared/httpd/node/node; pm2 start index.js' -l devilbox
|
||||
```
|
||||
|
||||
|
||||
## Note
|
||||
|
||||
This directory will startup commands only for a specific PHP version. If you want to run commands
|
||||
for all versions , go to `autostart/` in the root of the Devilbox git directory.
|
||||
|
||||
|
||||
## Important
|
||||
|
||||
All provided scripts will be executed with **root** permissions.
|
||||
|
@ -193,7 +193,8 @@ services:
|
||||
- ${DEVILBOX_PATH}/mod/php-fpm-${PHP_SERVER}:/usr/lib64/php/custom-modules:ro${MOUNT_OPTIONS}
|
||||
|
||||
# Mount devilbox user-defined PHP-FPM startup *.sh scripts
|
||||
- ${DEVILBOX_PATH}/cfg/php-startup-${PHP_SERVER}:/startup.d:rw${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/cfg/php-startup-${PHP_SERVER}:/startup.1.d:rw${MOUNT_OPTIONS}
|
||||
- ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS}
|
||||
|
||||
# Mount devilbox user-defined bash config
|
||||
- ${DEVILBOX_PATH}/bash:/etc/bashrc-devilbox.d:rw${MOUNT_OPTIONS}
|
||||
|
Loading…
Reference in New Issue
Block a user