Good Day,
We are testing vSphere Docker Volume Service. I deploy the following :
version: '3'
services:
db:
image: mariadb
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
environment:
MYSQL_ROOT_PASSWORD: rootpasswd
MYSQL_USER: wp
MYSQL_PASSWORD: wppasswd
MYSQL_DATABASE: wp
volumes:
- mariadb:/var/lib/sql
web:
image: wordpress:latest
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
depends_on:
- db
ports:
- "8080:80"
environment:
WORDPRESS_DB_USER: wp
WORDPRESS_DB_PASSWORD: wppasswd
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_NAME: wp
volumes:
mariadb:
driver: vsphere
driver_opts:
size: 1Gb
diskformat: zeroedthick
I publish content within Wordpress and then as a test I kill the Node that MariaDB is running on. It starts on another node, but, seems to create as brand new .vmdk as Wordpress just defaults back to the installation page.
I can create the .vmdk outside of the Compose file :
docker volume create --driver=vsphere --name=mariadb -o size=1gb -o diskformat=zeroedthick
… but how do I incorporate it within the Database Section of the Compose file as apposed to a seperate Volumes section ?
Regards