mirror of
https://github.com/cytopia/devilbox.git
synced 2025-01-18 02:40:04 +00:00
Merge pull request #45 from cytopia/DVL-010
DVL-010 Make MySQL|PgSQL data dirs dynamic depending on version
This commit is contained in:
commit
d094ea6388
@ -415,9 +415,13 @@
|
||||
<th>Document Root</th>
|
||||
<td><?php echo $Docker->getEnv('HOST_PATH_TO_WWW_DOCROOTS');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Custom config</th>
|
||||
<td>./etc/<?php echo $Docker->getEnv('HTTPD_SERVER');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Log directory</th>
|
||||
<td>./log</td>
|
||||
<td>./log/<?php echo $Docker->getEnv('HTTPD_SERVER');?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -441,11 +445,11 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Custom config</th>
|
||||
<td>./etc</td>
|
||||
<td>./etc/<?php echo $Docker->getEnv('PHP_SERVER');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Log directory</th>
|
||||
<td>./log</td>
|
||||
<td>./log/<?php echo $Docker->getEnv('PHP_SERVER');?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -466,11 +470,15 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>MySQL datadir</th>
|
||||
<td><?php echo $Docker->getEnv('HOST_PATH_TO_MYSQL_DATADIR');?></td>
|
||||
<td><?php echo $Docker->getEnv('HOST_PATH_TO_MYSQL_DATADIR').'/'.$Docker->getEnv('MYSQL_SERVER');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Custom config</th>
|
||||
<td>./etc/<?php echo $Docker->getEnv('MYSQL_SERVER');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Log directory</th>
|
||||
<td>./log</td>
|
||||
<td>./log/<?php echo $Docker->getEnv('MYSQL_SERVER');?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -491,11 +499,11 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Postgres datadir</th>
|
||||
<td><?php echo $Docker->getEnv('HOST_PATH_TO_POSTGRES_DATADIR');?></td>
|
||||
<td><?php echo $Docker->getEnv('HOST_PATH_TO_POSTGRES_DATADIR').'/'.$Docker->getEnv('POSTGRES_SERVER');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Log directory</th>
|
||||
<td>./log</td>
|
||||
<td>./log/postgres-<?php echo $Docker->getEnv('POSTGRES_SERVER');?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -162,6 +162,11 @@ services:
|
||||
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
||||
- POSTGRES_USER=${POSTGRES_USER}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
# Server versions
|
||||
- PHP_SERVER=${PHP_SERVER}
|
||||
- HTTPD_SERVER=${HTTPD_SERVER}
|
||||
- POSTGRES_SERVER=${POSTGRES_SERVER}
|
||||
- MYSQL_SERVER=${MYSQL_SERVER}
|
||||
|
||||
##
|
||||
## Register optional enabled docker containers to PHP
|
||||
@ -258,7 +263,7 @@ services:
|
||||
- ${DEVILBOX_PATH}/cfg/${MYSQL_SERVER}:/etc/mysql/conf.d:ro
|
||||
|
||||
# Mount MySQL Data directory
|
||||
- ${HOST_PATH_TO_MYSQL_DATADIR}:/var/lib/mysql
|
||||
- ${HOST_PATH_TO_MYSQL_DATADIR}/${MYSQL_SERVER}:/var/lib/mysql
|
||||
|
||||
|
||||
# ----------------------------------------
|
||||
@ -297,7 +302,7 @@ services:
|
||||
- pgsql_socket_volume:/var/run/postgresql
|
||||
|
||||
# Mount PostgreSQL Data directory
|
||||
- ${HOST_PATH_TO_POSTGRES_DATADIR}:/var/lib/postgresql/data/pgdata
|
||||
- ${HOST_PATH_TO_POSTGRES_DATADIR}/${POSTGRES_SERVER}:/var/lib/postgresql/data/pgdata
|
||||
|
||||
|
||||
# ----------------------------------------
|
||||
|
@ -162,6 +162,11 @@ services:
|
||||
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
||||
- POSTGRES_USER=${POSTGRES_USER}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
# Server versions
|
||||
- PHP_SERVER=${PHP_SERVER}
|
||||
- HTTPD_SERVER=${HTTPD_SERVER}
|
||||
- POSTGRES_SERVER=${POSTGRES_SERVER}
|
||||
- MYSQL_SERVER=${MYSQL_SERVER}
|
||||
|
||||
networks:
|
||||
app_net:
|
||||
@ -251,7 +256,7 @@ services:
|
||||
- ${DEVILBOX_PATH}/cfg/${MYSQL_SERVER}:/etc/mysql/conf.d:ro
|
||||
|
||||
# Mount MySQL Data directory
|
||||
- ${HOST_PATH_TO_MYSQL_DATADIR}:/var/lib/mysql
|
||||
- ${HOST_PATH_TO_MYSQL_DATADIR}/${MYSQL_SERVER}:/var/lib/mysql
|
||||
|
||||
|
||||
# ----------------------------------------
|
||||
@ -290,7 +295,7 @@ services:
|
||||
- pgsql_socket_volume:/var/run/postgresql
|
||||
|
||||
# Mount PostgreSQL Data directory
|
||||
- ${HOST_PATH_TO_POSTGRES_DATADIR}:/var/lib/postgresql/data/pgdata
|
||||
- ${HOST_PATH_TO_POSTGRES_DATADIR}/${POSTGRES_SERVER}:/var/lib/postgresql/data/pgdata
|
||||
|
||||
|
||||
################################################################################
|
||||
|
13
env-example
13
env-example
@ -138,7 +138,12 @@ HOST_PATH_TO_WWW_DOCROOTS=./data/www
|
||||
### If this directory is empty, a new mysql database will be
|
||||
### created.
|
||||
###
|
||||
HOST_PATH_TO_MYSQL_DATADIR=./data/mysql57
|
||||
### Note: Inside this path, a subdirectory with the mysql|mariadb
|
||||
### version will be created where the actual data resides.
|
||||
### This is to protect databases from being altered by
|
||||
### newer or older mysql|mariadb server versions.
|
||||
###
|
||||
HOST_PATH_TO_MYSQL_DATADIR=./data/mysql
|
||||
|
||||
###
|
||||
### Local filesystem path to postgresql datadir.
|
||||
@ -150,7 +155,11 @@ HOST_PATH_TO_MYSQL_DATADIR=./data/mysql57
|
||||
### If this directory is empty, a new postgresql database will be
|
||||
### created.
|
||||
###
|
||||
HOST_PATH_TO_POSTGRES_DATADIR=./data/postgres96
|
||||
### Note: Inside this path, a subdirectory with the postgresql
|
||||
### version will be created where the actual data resides.
|
||||
### This is to protect databases from being altered by
|
||||
### newer or older postgres server versions.
|
||||
HOST_PATH_TO_POSTGRES_DATADIR=./data/pgsql
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user