I'm trying to dockerize my Laravel app. In my local machine i have Mysql and MongoDB.
I have a script that run mysql
restore and mongorestore
to restore a production db.
In local environment i don't have problems because mysql and mongodb are installed locally.
Now, i created a docker-compose.yml
with the build instructions:
version: '3'
services:
app:
build:
context: .
dockerfile: .docker/Dockerfile.dev
image: laravel-docker
ports:
- 8080:80
volumes:
- /srv/app/vendor
- .:/srv/app
links:
- mariadb
- redis
redis:
image: redis:latest
mariadb:
image: mariadb:latest
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
- MYSQL_USER=root
mongo:
image: mongo
All works fine but i need to run mysql
command from app
container (that should call mysql
command in mariadb container)