Below is example code:
services:
db:
image: "mysql:8"
restart: always
environment:
MYSQL_DATABASE: 'test'
MYSQL_USER: 'root'
MYSQL_PASSWORD: 'test'
MYSQL_ROOT_PASSWORD: 'test'
ports:
- "3309:3306"
expose:
- "3309"
By definition, in docker-compose file, does expose:
function on the host port or the container port?
Does ports:
follow the [host_port]:[container_port]
convention or [container_port]:[host_port]
?
what exactly is the example code above doing with ports?