hellgate75/h2-database - Full featured H2 Database server
Full featured H2 Database server for simulation of production environments
Goals
Definition of full working and full features container. Userful for local or real environment deployment. It's suitable for docker, docker-swarm, Kubernetes, Mesos, Rancher, etc ...
Reference Docker Image
FROM hellgate75/oracle-jdk8:1.8.241-x64
Environment variables
H2_ENV: Environment folder for the database (default: D3)
H2_WEB_PORT: Web Module Port (none|, default: 9090)
H2_TCP_PORT: TCP Database Port (none|, default: 65123)
H2_PG_PORT: PG Module Port (none|, default: 9023)
H2_ENABLE_WEB: Enable Web feature (1|0|true|false, default: false)
H2_ENABLE_PG: Enable PG feature (1|0|true|false, default: false)
H2_ENABLE_INSECURE: Databases are created when accessed (1|0|true|false, default: false)
H2_ENABLE_SECURE: Only existing databases may be opened (1|0|all servers, default: false)
H2_BROWSER: Start a browser connecting to the web server (1|0|true|false, default: false)
H2_ENABLE_DAEMONS: Enable daemons sample(none|web,pg,tcp, default: none)
H2_PROPS_FOLDER: Server properties (default: ~, disable: null, default: null)
H2_ENABLE_WEB_SSL: Use encrypted (HTTPS) connections (1|0|true|false, default: false)
H2_ENABLE_TCP_SSL: Use encrypted (SSL) connections, default: false)
H2_ENABLE_WEB_PASSWORD: Enable Password of DB Console administrator (1|0|true|false, default: false)
H2_WEB_PASSWORD: The Password of DB Console (none|, default: none)
H2_ENABLE_TCP_PASSWORD: Enable Password for shutting down a TCP server (1|0|true|false, default: false)
H2_TCP_PASSWORD: The password for shutting down a TCP server (none|, default: none)
H2_TRACE: Enable Print additional trace information (all servers) (1|0|true|false, default: false)
H2_SHUTDOWN_URL: Stop the TCP server; example: tcp://localhost (none|, default: none)
H2_FORCE_SHUTDOWN: Do not wait until all connections are closed (1|0|true|false, default: false)
H2_DATA_GIT_URL: Stop the TCP server; example: git@github/com/{user}/{repo_name}.git|{folder|/};git@github/com/{user}/{repo_name}.git|{folder|/};... (none|value, default: none)
H2_DATA_GIT_REFRESH: Refresh the git-url database files at any start-up (false|true, default: false)
GIT CLONE FEATURE
Using ENVIRONMENT VARIABLE H2_DATA_GIT_URL you are using following data model:
git@github/com/{user}/{repo_name}.git|{folder|/};git@github/com/{user}/{repo_name}.git|{folder|/};....
It means that in any token separated by character ';' you can insert a key-value pair containing :
repository ssh url: eg -> [email protected] :hellgate75/dataflow-flow-centric-config.git
a folder in the repository in absolute path: eg -> /data
It results something like [email protected] :hellgate75/dataflow-flow-centric-config.git|/data. It means that the docker container at first start-up has to:
clone [email protected] :hellgate75/dataflow-flow-centric-config.git repository
go in ./dataflow-flow-centric-config/data
seek for *.db files into this folder (no nested folder are scanned)
copy that .db files into the db data.
You can separate multiple repositories
If the container can be stopped and started often, and you want to reset or update continuosly the container with a fresh database image you have to change this environment variable H2_DATA_GIT_REFRESH moving from false to true.
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCsJgj4MYoba3UmeR0qVKg7FROfij4NPYpYGfMAEtwUUse9Rn7/I+2fNwIRy4NZ4RgAaD0Wqsy5urRvmnq3fLDl2KJ+DwSrQ8K5TD5DU8qvAWinGbK2pVgCgumoBkGRm4cbTdR1EJdTftykBGiod8Ydg2I9Gbatl9hzAW9IeEHf574EE2RFu2oDERMqGnP0eAi6DGfkMzhktVUecFNU10Ckt97PUOhF3Vr1ggeqZK4+ak/2n/91AqrKXgUkFohLgxBWtpA+d+a/gKaXyWOguvIyRAEkdzIMQRVmIk+G3cmffoEQC1RUaZYuCfRTi7CKHc9aqRRMvbyj5cyzhm7pL95YIJbwSoLT+9veK4sq3QPL/iK8xQFsMtQQ5EXoo0oa7+nU5b3fxEJCa2tjxypDuxu0OM/BjsjN3DuFY9A9IxW/hMWmxq0vGhcueQO/Fg9vhxIy+jllEGjC6DzcBoR0hGBnpup1dUqRzmQV4/LNOuE/vggPF/QxfoBLVPY8QdGU/T8= root@27e88327fef3
EXPOSES PORTS
9090: HTTP Web console Port
65123: TCP database console Port
9023: PG Server Port
VOLUMES
/var/h2-database/data: Database folder (useful for rehydratation or clustering)
SAMPLE COMMANDS
docker run -d --tty --rm -v h2_data_volume:/var/h2-database/data -p 9081:9090 -p 65123:65123 -e "H2_ENABLE_WEB=true" -e "H2_ENABLE_INSECURE=true" -e "H2_ENABLE_SECURE=false" -e "H2_DATA_GIT_URL=[email protected] :hellgate75/dataflow-flow-centric-config.git|/data" --name test-h2-2 hellgate75/h2-database:2019.10.14