Hello. Wondering if anyone could help with this, as my understanding of Docker is limited
I’ve been following along with the PHP Novice To Ninja books and have created my own site based on it locally in a Docker container. I know want to extract an SQL file of the database structure to deploy on a web server, but MySQL Workbench (which the book recommends) can’t Data Export with the Docker environment detailed in the book.
So I found the following:
Blockquote
docker exec -i mysql_container mysqldump -uroot -proot --databases database_name --skip-comments > /path/to/my/dump.sql
I’m just not sure what my relevant fields to fill in are. Here is the docker-compose.yml
Blockquote
version: '3.8'
services:
updatecerts:
image: vjedev/certupdater:latest
volumes:
- certs:/certs
- mysqlconf:/mysqlconf
landingpage:
image: vjedev/landingpage:latest
volumes:
- ./websites:/websites
databaseimportexport:
image: vjedev/database-import-export:latest
volumes:
- ./websites:/websites
depends_on:
- mysql
web:
image: nginx:latest
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/nginx.conf
- certs:/certs
- ./websites:/websites
depends_on:
- updatecerts
php:
build:
context: .
dockerfile: PHP.Dockerfile
volumes:
- ./websites:/websites
mysql:
image: mariadb:latest
environment:
MYSQL_ROOT_PASSWORD: 'v.je'
MYSQL_USER: 'v.je'
MYSQL_PASSWORD: 'v.je'
volumes:
- mysqldata:/var/lib/mysql
- certs:/ssl
- mysqlconf:/etc/mysql/conf.d/
ports:
- 3306:3306
phpunit:
image: phpunit/phpunit:latest
working_dir: /websites/default
volumes:
- ./websites:/websites
profiles:
- phpunit
composer:
image: composer:latest
working_dir: /websites/default
volumes:
- ./websites:/websites
profiles:
- composer
maildev:
volumes:
mysqldata: {}
certs: {}
mysqlconf: {}