mirror of
https://github.com/cytopia/devilbox.git
synced 2024-12-24 06:56:40 +00:00
DVL-012 be able to customize bash config files
This commit is contained in:
parent
5c22c045a1
commit
bb0a15f4e6
4
.gitignore
vendored
4
.gitignore
vendored
@ -53,6 +53,10 @@
|
|||||||
/mod/php-fpm-7.2/*.so
|
/mod/php-fpm-7.2/*.so
|
||||||
/mod/hhvm-latest/*.so
|
/mod/hhvm-latest/*.so
|
||||||
|
|
||||||
|
# Ignore custom bash and other confi files
|
||||||
|
/bash/*
|
||||||
|
!/bash/bashrc.sh-example
|
||||||
|
!/bash/README.md
|
||||||
|
|
||||||
######################################
|
######################################
|
||||||
# GENERIC
|
# GENERIC
|
||||||
|
@ -165,15 +165,16 @@ Every single attachable container comes with many different versions. In order t
|
|||||||
|
|
||||||
#### Enter the container
|
#### Enter the container
|
||||||
|
|
||||||
You can also work directly inside the php container. Simply use the bundled scripts `bash.sh` or `root_bash.sh`. The `PS1` will automatically be populated with current chosen php version.
|
You can also work directly inside the php container. Simply use the bundled scripts `shell.sh`. The `PS1` will automatically be populated with current chosen php version.
|
||||||
```shell
|
```shell
|
||||||
# Enter as user devilbox (normal operation / development)
|
# Enter as user devilbox (normal operation / development)
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
devilbox@php-7.0.19 in /shared/httpd $
|
devilbox@php-7.0.19 in /shared/httpd $
|
||||||
```
|
```
|
||||||
```shell
|
```shell
|
||||||
# Enter as root user (do root stuff)
|
# Enter as root user (do root stuff)
|
||||||
host> ./root_bash.sh
|
host> ./shell.sh
|
||||||
|
devilbox@php-7.0.19 in /shared/httpd $ sudo su -
|
||||||
root@php-7.0.19 in /shared/httpd $
|
root@php-7.0.19 in /shared/httpd $
|
||||||
```
|
```
|
||||||
|
|
||||||
|
0
bash/README.md
Normal file
0
bash/README.md
Normal file
14
bash/bashrc.sh-example
Normal file
14
bash/bashrc.sh-example
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# Bashrc folder
|
||||||
|
#
|
||||||
|
# 1. This folder will be mounted to /etc/bashrc-devilbox.d
|
||||||
|
# 2. All files ending by *.sh will be sourced by bash automatically
|
||||||
|
# for the devilbox and root user.
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
# Add your custom vimrc and always load it with vim.
|
||||||
|
# Also make sure you add vimrc to this folder.
|
||||||
|
alias vim='vim -u /etc/bashrc-devilbox.d/vimrc
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -185,6 +185,9 @@ services:
|
|||||||
# to load custom PHP modules
|
# to load custom PHP modules
|
||||||
- ${DEVILBOX_PATH}/mod/${PHP_SERVER}:/usr/lib64/php/custom-modules:ro
|
- ${DEVILBOX_PATH}/mod/${PHP_SERVER}:/usr/lib64/php/custom-modules:ro
|
||||||
|
|
||||||
|
# Mount devilbox user-defined bash config
|
||||||
|
- ${DEVILBOX_PATH}/bash:/etc/bashrc-devilbox.d
|
||||||
|
|
||||||
# Mount custom mass virtual hosting
|
# Mount custom mass virtual hosting
|
||||||
# (configured in /etc/${HTTPD_SERVER}/02-vhost-mass.conf)
|
# (configured in /etc/${HTTPD_SERVER}/02-vhost-mass.conf)
|
||||||
- ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd
|
- ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd
|
||||||
|
@ -81,7 +81,7 @@ There are many different options to backup your MySQL database including some fo
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# Enter the Container
|
# Enter the Container
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
|
|
||||||
# Start the backup
|
# Start the backup
|
||||||
devilbox@php-7.1.6 in /shared/httpd $ mysqldump-secure
|
devilbox@php-7.1.6 in /shared/httpd $ mysqldump-secure
|
||||||
@ -209,7 +209,7 @@ To find out more about the configuration and options of mysqldump-secure, visit
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# Enter the Container
|
# Enter the Container
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
|
|
||||||
# Start the backup
|
# Start the backup
|
||||||
devilbox@php-7.1.6 in /shared/httpd $ mysqldump -h mysql -u root -p my_db_name > /shared/backups/mysql/my_db_name.sql
|
devilbox@php-7.1.6 in /shared/httpd $ mysqldump -h mysql -u root -p my_db_name > /shared/backups/mysql/my_db_name.sql
|
||||||
@ -239,7 +239,7 @@ In order to restore or import mysql databases on the command line, you need to u
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# Enter the Container
|
# Enter the Container
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
|
|
||||||
# Start the import
|
# Start the import
|
||||||
devilbox@php-7.1.6 in /shared/httpd $ mysql -h mysql -u root -p my_db_name < /shared/backups/mysql/my_db_name.sql
|
devilbox@php-7.1.6 in /shared/httpd $ mysql -h mysql -u root -p my_db_name < /shared/backups/mysql/my_db_name.sql
|
||||||
@ -249,7 +249,7 @@ devilbox@php-7.1.6 in /shared/httpd $ mysql -h mysql -u root -p my_db_name < /sh
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# Enter the Container
|
# Enter the Container
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
|
|
||||||
# Start the import
|
# Start the import
|
||||||
devilbox@php-7.1.6 in /shared/httpd $ zcat /shared/backups/mysql/my_db_name.sql.gz | mysql -h mysql -u root -p my_db_name
|
devilbox@php-7.1.6 in /shared/httpd $ zcat /shared/backups/mysql/my_db_name.sql.gz | mysql -h mysql -u root -p my_db_name
|
||||||
@ -259,7 +259,7 @@ devilbox@php-7.1.6 in /shared/httpd $ zcat /shared/backups/mysql/my_db_name.sql.
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# Enter the Container
|
# Enter the Container
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
|
|
||||||
# Start the import
|
# Start the import
|
||||||
devilbox@php-7.1.6 in /shared/httpd $ tar xzOf /shared/backups/mysql/my_db_name.sql.tar.gz | mysql -h mysql -u root -p my_db_name
|
devilbox@php-7.1.6 in /shared/httpd $ tar xzOf /shared/backups/mysql/my_db_name.sql.tar.gz | mysql -h mysql -u root -p my_db_name
|
||||||
@ -284,7 +284,7 @@ devilbox@php-7.1.6 in /shared/httpd $ tar xzOf /shared/backups/mysql/my_db_name.
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# Enter the Container
|
# Enter the Container
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
|
|
||||||
# Start the import
|
# Start the import
|
||||||
devilbox@php-7.1.6 in /shared/httpd $ pg_dump -h pgsql -U postgres -W my_db_name > /shared/backups/pgsql/my_db_name.sql
|
devilbox@php-7.1.6 in /shared/httpd $ pg_dump -h pgsql -U postgres -W my_db_name > /shared/backups/pgsql/my_db_name.sql
|
||||||
@ -308,7 +308,7 @@ In order to restore or import PostgreSQL databases on the command line, you need
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# Enter the Container
|
# Enter the Container
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
|
|
||||||
# Start the import
|
# Start the import
|
||||||
devilbox@php-7.1.6 in /shared/httpd $ psql -h pgsql -U postgres -W my_db_name < /shared/backups/pgsql/my_db_name.sql
|
devilbox@php-7.1.6 in /shared/httpd $ psql -h pgsql -U postgres -W my_db_name < /shared/backups/pgsql/my_db_name.sql
|
||||||
@ -318,7 +318,7 @@ devilbox@php-7.1.6 in /shared/httpd $ psql -h pgsql -U postgres -W my_db_name <
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# Enter the Container
|
# Enter the Container
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
|
|
||||||
# Start the import
|
# Start the import
|
||||||
devilbox@php-7.1.6 in /shared/httpd $ zcat /shared/backups/pgsql/my_db_name.sql.gz | psql -h pgsql -U postgres -W my_db_name
|
devilbox@php-7.1.6 in /shared/httpd $ zcat /shared/backups/pgsql/my_db_name.sql.gz | psql -h pgsql -U postgres -W my_db_name
|
||||||
@ -328,7 +328,7 @@ devilbox@php-7.1.6 in /shared/httpd $ zcat /shared/backups/pgsql/my_db_name.sql.
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# Enter the Container
|
# Enter the Container
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
|
|
||||||
# Start the import
|
# Start the import
|
||||||
devilbox@php-7.1.6 in /shared/httpd $ tar xzOf /shared/backups/pgsql/my_db_name.sql.tar.gz | psql -h pgsql -U postgres -W my_db_name
|
devilbox@php-7.1.6 in /shared/httpd $ tar xzOf /shared/backups/pgsql/my_db_name.sql.tar.gz | psql -h pgsql -U postgres -W my_db_name
|
||||||
@ -349,7 +349,7 @@ devilbox@php-7.1.6 in /shared/httpd $ tar xzOf /shared/backups/pgsql/my_db_name.
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# Enter the Container
|
# Enter the Container
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
|
|
||||||
# Start the dump into /shared/backups/mongo
|
# Start the dump into /shared/backups/mongo
|
||||||
devilbox@php-7.1.6 in /shared/httpd $ mongodump --out /shared/backups/mongo
|
devilbox@php-7.1.6 in /shared/httpd $ mongodump --out /shared/backups/mongo
|
||||||
@ -365,7 +365,7 @@ To find out more about the configuration and options of mongodump, visit its pro
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# Enter the Container
|
# Enter the Container
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
|
|
||||||
# Start the restore/import from /shared/backups/mongo
|
# Start the restore/import from /shared/backups/mongo
|
||||||
devilbox@php-7.1.6 in /shared/httpd $ mongorestore /shared/backups/mongo
|
devilbox@php-7.1.6 in /shared/httpd $ mongorestore /shared/backups/mongo
|
||||||
|
@ -92,7 +92,7 @@ It will be ready in eight simple steps:
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# 1. Enter the PHP container
|
# 1. Enter the PHP container
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
|
|
||||||
# 2. Create a new VirtualHost directory
|
# 2. Create a new VirtualHost directory
|
||||||
devilbox@php-7.0.20 in /shared/httpd $ mkdir my-cake
|
devilbox@php-7.0.20 in /shared/httpd $ mkdir my-cake
|
||||||
@ -165,7 +165,7 @@ It will be ready in six simple steps:
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# 1. Enter the PHP container
|
# 1. Enter the PHP container
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
|
|
||||||
# 2. Create a new VirtualHost directory
|
# 2. Create a new VirtualHost directory
|
||||||
devilbox@php-7.0.20 in /shared/httpd $ mkdir my-drupal
|
devilbox@php-7.0.20 in /shared/httpd $ mkdir my-drupal
|
||||||
@ -213,7 +213,7 @@ It will be ready in six simple steps:
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# 1. Enter the PHP container
|
# 1. Enter the PHP container
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
|
|
||||||
# 2. Create a new VirtualHost directory
|
# 2. Create a new VirtualHost directory
|
||||||
devilbox@php-7.0.20 in /shared/httpd $ mkdir my-laravel
|
devilbox@php-7.0.20 in /shared/httpd $ mkdir my-laravel
|
||||||
@ -259,7 +259,7 @@ It will be ready in six simple steps:
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# 1. Enter the PHP container
|
# 1. Enter the PHP container
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
|
|
||||||
# 2. Create a new VirtualHost directory
|
# 2. Create a new VirtualHost directory
|
||||||
devilbox@php-7.0.20 in /shared/httpd $ mkdir my-phalcon
|
devilbox@php-7.0.20 in /shared/httpd $ mkdir my-phalcon
|
||||||
@ -306,7 +306,7 @@ It will be ready in six simple steps:
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# 1. Enter the PHP container
|
# 1. Enter the PHP container
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
|
|
||||||
# 2. Create a new VirtualHost directory
|
# 2. Create a new VirtualHost directory
|
||||||
devilbox@php-7.0.20 in /shared/httpd $ mkdir my-symfony
|
devilbox@php-7.0.20 in /shared/httpd $ mkdir my-symfony
|
||||||
@ -356,7 +356,7 @@ It will be ready in six simple steps:
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# 1. Enter the PHP container
|
# 1. Enter the PHP container
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
|
|
||||||
# 2. Create a new VirtualHost directory
|
# 2. Create a new VirtualHost directory
|
||||||
devilbox@php-7.0.20 in /shared/httpd $ mkdir my-wp
|
devilbox@php-7.0.20 in /shared/httpd $ mkdir my-wp
|
||||||
@ -402,7 +402,7 @@ It will be ready in six simple steps:
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# 1. Enter the PHP container
|
# 1. Enter the PHP container
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
|
|
||||||
# 2. Create a new VirtualHost directory
|
# 2. Create a new VirtualHost directory
|
||||||
devilbox@php-7.0.20 in /shared/httpd $ mkdir my-yii
|
devilbox@php-7.0.20 in /shared/httpd $ mkdir my-yii
|
||||||
@ -448,7 +448,7 @@ It will be ready in six simple steps:
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# 1. Enter the PHP container
|
# 1. Enter the PHP container
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
|
|
||||||
# 2. Create a new VirtualHost directory
|
# 2. Create a new VirtualHost directory
|
||||||
devilbox@php-7.0.20 in /shared/httpd $ mkdir my-zend
|
devilbox@php-7.0.20 in /shared/httpd $ mkdir my-zend
|
||||||
|
@ -204,7 +204,7 @@ To quickly find setup instructions for your framework of choice head over to **[
|
|||||||
The PHP Docker container is your workhorse which has many tools pre-installed and you can do every task inside instead of doing it on the docker host. Entering the container is done via a shipped script:
|
The PHP Docker container is your workhorse which has many tools pre-installed and you can do every task inside instead of doing it on the docker host. Entering the container is done via a shipped script:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
devilbox@php-7.0.19 in /shared/httpd $
|
devilbox@php-7.0.19 in /shared/httpd $
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -100,10 +100,10 @@ The situation inside the container is not different from on the Docker host. All
|
|||||||
|
|
||||||
#### 3.1 As devilbox user
|
#### 3.1 As devilbox user
|
||||||
|
|
||||||
In the devilbox git directory you will find a bash script called `bash.sh`. Just execute this script and it will take you directly into the PHP docker container at the project root directory.
|
In the devilbox git directory you will find a bash script called `shell.sh`. Just execute this script and it will take you directly into the PHP docker container at the project root directory.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
host> ./bash.sh
|
host> ./shell.sh
|
||||||
devilbox@php-7.0.19 in /shared/httpd $
|
devilbox@php-7.0.19 in /shared/httpd $
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -111,10 +111,11 @@ As you can see, the PS1 prompt will also show you the current configured PHP ver
|
|||||||
|
|
||||||
#### 3.2 As root user
|
#### 3.2 As root user
|
||||||
|
|
||||||
In case you need to perform some tasks that are only possible with root rights (such as installing or updating software), you can also use the `root_bash.sh` script.
|
In case you need to perform some tasks that are only possible with root rights (such as installing or updating software), you can do so via password-less `sudo`.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
host> ./root_bash.sh
|
host> ./shell.sh
|
||||||
|
devilbox@php-7.0.19 in /shared/httpd $ sudo su -
|
||||||
root@php-7.0.19 in /shared/httpd $
|
root@php-7.0.19 in /shared/httpd $
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
CWD="/shared/httpd"
|
|
||||||
docker-compose exec --user root php env TERM=xterm /bin/sh -c "cd ${CWD}; exec bash -l"
|
|
Loading…
Reference in New Issue
Block a user