Docker Configuration to allow access to Database App.

Please follow & like us :)

Docker

Many times when you run your application using docker, you need to use sequel pro or other database App.

You need to specify config and allow other Sequel Pro App.

Below is the config which you should add in docker-compose yaml file.
database:
    container_name: ""
    image: ""
    ports:
      - 3306:3306
    restart: always
    volumes:
      - ""
      - ""

Also, You should update the Docker file as well.

Here is the config which you should add in Docker file.
EXPOSE 3306

If you forget to add those config you get an error saying

Can’t connect to MySQL server on ‘127.0.0.1’