Merge pull request #45 from cytopia/DVL-010

DVL-010 Make MySQL|PgSQL data dirs dynamic depending on version
This commit is contained in:
cytopia 2017-04-23 20:37:30 +02:00 committed by GitHub
commit d094ea6388
4 changed files with 40 additions and 13 deletions

View File

@ -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>

View File

@ -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
# ----------------------------------------

View File

@ -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
################################################################################

View File

@ -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