hosts - Using custom hostnames for docker local development containers -


i playing around docker windows (just starting out) , have simple docker-compose.yml works great:

version: '2.1'  services:    db:      image: mysql:latest      container_name: wordpresslab_db      volumes:        - db_data:/var/lib/mysql      restart:      environment:        mysql_root_password: wordpress        mysql_user: wordpress        mysql_database: wordpress        mysql_password: wordpress     phpmyadmin:      image: phpmyadmin/phpmyadmin      container_name: wordpresslab_phpmyadmin      volumes:        - /sessions      ports:        - "8090:80"      depends_on:        - db     wordpress:      image: wordpress:latest      container_name: wordpresslab_wordpress      volumes:        - ./:/var/www/html      ports:        - "8080:80"      depends_on:        - db      restart:      environment:        wordpress_db_host: db:3306        wordpress_db_password: wordpress volumes:     db_data: 

once run docker-compose -d creates containers database, phpmyadmin , wordpress website , accessible , working ok.

my question is, how setup "project.dev" instead of "localhost:8080" access wordpress site , "phpmyadmin.dev" instead of "localhost:8090" access phpmyadmin? other tools need? note using windows 10 host.

i think want use port mapping described in networking doc.

https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/container-networking#network-creation

there's docker doc on ports in compose files.
https://docs.docker.com/compose/compose-file/#long-syntax

please note there differences in syntax depending on version of docker compose using. can check version running command in command prompt: docker-compose --version

let me know if you're still running trouble!


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -