Skip to content

Instantly share code, notes, and snippets.

@arielgk
Created October 14, 2019 22:16
Show Gist options
  • Select an option

  • Save arielgk/7cbd60e8a0fc47061f0e1f17ac65e9bd to your computer and use it in GitHub Desktop.

Select an option

Save arielgk/7cbd60e8a0fc47061f0e1f17ac65e9bd to your computer and use it in GitHub Desktop.
docker compose mysql phpmyadmin with 127.0.0.1 hostname
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=dbname
DB_USERNAME=root
DB_PASSWORD="0000"
version: '3.1'
services:
mysql_inst:
image: mysql:latest
command: --default-authentication-plugin=mysql_native_password
network_mode: "host"
# ports:
# - 8083:3306
volumes:
- ./mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: "0000"
# MYSQL_DATABASE: myDb
myadmin:
image: phpmyadmin/phpmyadmin:latest
restart: always
environment:
MYSQL_USERNAME: root
MYSQL_ROOT_PASSWORD: "0000"
volumes:
- ./localpath/custom.ini:/usr/local/etc/php/conf.d/custom.ini
links:
- "mysql_inst:db"
ports:
- 8080:80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment