version: "3"
services:
myapp:
build:
context: .
links:
- mariadb
expose:
- 6969
ports:
- "6969:6969"
networks:
- app-network
depends_on:
- mariadb
restart: always
mariadb:
image: mariadb:10.11.8
container_name: mariadb
restart: always
environment:
- MYSQL_DATABASE=mydatabase
- MYSQL_ROOT_PASSWORD=mypassword
ports:
- "3306:3306"
expose:
- 3306
volumes:
- ./db/data:/var/lib/mysql
- ./schema.sql:/docker-entrypoint-initdb.d/schema.sql
networks:
- app-network
networks:
app-network:
driver: bridge
when i build with this docker-compose the app can see the database and interact with it, but i cannot access the db with dbeaver or similar applications over the internet, how do i expose the database so that i can connect to it via dbeaver or directly from the outside.
this is the error:
Could not connect to myip here
:3306 : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond