docker-php7
docker-php7 copied to clipboard
How to connect to the DB?
How exactly do I connect to the DB after the docker is running?
I combined this project and opencart, but when i register account, 504 timeout nginx. How should I do ?. Thank you
Add ports to the db
service:
version: "2"
services:
nginx:
build:
context: ./nginx
ports:
- "8080:80"
volumes:
- ./app:/var/app
fpm:
build:
context: ./fpm
volumes:
- ./app:/var/app
expose:
- "9000"
environment:
- "DB_HOST=db"
- "DB_DATABASE=laravel"
db:
image: mariadb:10.4.12
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=laravel
volumes:
- ./database:/var/lib/mysql
Then you can connect using:
mysql -u root -p