Hi,
I'm new in docker, so need some help regarding making connection to localhost database or server database to my docker application. So I don't want to use docker image like mysql or mariadb to connect my application, but want to use localhost database to make connection to docker application. Can you please help me how I can achieve that?
Below is my yml file, so I need to know should I've to use mariadb image in order to use external database, because I don't want to use docker mariadb image for connection.
version: '3.7'
services:
web:
container_name: ${APP_NAME}
build:
context: .
dockerfile: ./Dockerfile
ports:
- "8081:80"
volumes:
- ./:/var/www/html/laravel
depends_on:
- mariadb
links:
- mariadb
mariadb:
image: mariadb
container_name: mariadb
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: laravel
MYSQL_USER: root
MYSQL_PASSWORD: passowrd
ports:
- "3309:33091"