Last active
July 2, 2022 21:06
-
-
Save hasinhayder/b1467216c353f5032575b79b53ef0394 to your computer and use it in GitHub Desktop.
mariadb and phpmyadmin docker image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.1' | |
services: | |
mariadb: | |
image: mariadb:10.8 | |
restart: always | |
ports: | |
- 3306:3306 | |
volumes: | |
- ./mariadb:/var/lib/mysql | |
environment: | |
- MYSQL_ROOT_PASSWORD=root | |
- MYSQL_PASSWORD=admin | |
- MYSQL_USER=admin | |
- MYSQL_DATABASE=test | |
- MYSQL_TCP_PORT=3306 | |
phpMyAdmin: | |
image: phpmyadmin | |
restart: always | |
ports: | |
- 8080:80 | |
environment: | |
- PMA_ARBITRARY=1 |
if MariaDB is running on another port, for example 3307, you can configure phpMyAdmin to connect on port 3307 like this
version: '3.1'
services:
mariadb:
image: mariadb:10.8
restart: always
ports:
- 3307:3306
volumes:
- ./mariadb:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_PASSWORD=admin
- MYSQL_USER=admin
- MYSQL_DATABASE=test
- MYSQL_TCP_PORT=3306
phpMyAdmin:
image: phpmyadmin
restart: always
ports:
- 8080:80
environment:
- PMA_PORT:3307
- PMA_ARBITRARY=1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
or simply run
docker ps
- you will see the image name as something likemariadb_mariadb_1
then you can log into the shell as
docker exec -it mariadb_mariadb_1 bash