https://hub.docker.com/_/mariadb
I'm curious whether I am going about this the wrong way??? I basically need to cat
custom config variables to my.cnf
. Can this be done via docker-compose.yml
or would I better off creating a separate Dockerfile for SQL image creation, allowing remote connections, thus adding a user, GRANT, FLUSH, etc?
Here is my docker-compose.yml:
services:
app:
build: .
ports:
- "80:80"
volumes:
- ./project:/home
sql:
image: mariadb
ports:
- "3606:3606"
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
EDIT |
/docker-entrypoint-initdb.d/setup.sh
mysql -u root -e "CREATE USER 'apps'@'%' IDENTIFIED BY ''; GRANT ALL PRIVILEGES ON *.* TO 'apps'@'%'; FLUSH PRIVILEGES;"
Do I need to add something to docker-compose.yml???