Skip to content

Instantly share code, notes, and snippets.

@dyarfi
Last active June 25, 2023 07:36
Show Gist options
  • Save dyarfi/4a8e64b265c41a4b84ceea859d95a38c to your computer and use it in GitHub Desktop.
Save dyarfi/4a8e64b265c41a4b84ceea859d95a38c to your computer and use it in GitHub Desktop.
Docker container for MySQL Database with PhpMyAdmin
version: "3.3"
services:
db:
container_name: mysqldb
image: mysql/mysql-server:8.0.23
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: test
MYSQL_ROOT_HOST: "%"
volumes:
- ./mysql-data/8.0.23:/var/lib/mysql
ports:
- 3307:3306
expose:
- 3307
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: phpmyadmin-mysql
links:
- db
restart: always
environment:
PMA_HOST: db
PMA_PORT: 3306
PMA_ARBITRARY: 1
ports:
- 8080:80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment