I created a docker container with docker-compose in my VPS and I want to access it from my local computer but the connection will refuse. also, I allowed the 3306 port in the VPS.
my docker-compose.yml
file:
version: "3"
services:
mariadb:
image: mariadb
container_name: mariadb
restart: 'always'
volumes:
- ./conf:/etc/mysql
environment:
MYSQL_ROOT_PASSWORD: ${password}
MYSQL_DATABASE: ${database}
MYSQL_USER: ${username}
MYSQL_PASSWORD: ${password}
ports:
- 3306:3306
how may I access the MariaDB server from my local computer?