Skip to content

Instantly share code, notes, and snippets.

@hasinhayder
Last active July 2, 2022 21:06
Show Gist options
  • Save hasinhayder/b1467216c353f5032575b79b53ef0394 to your computer and use it in GitHub Desktop.
Save hasinhayder/b1467216c353f5032575b79b53ef0394 to your computer and use it in GitHub Desktop.
mariadb and phpmyadmin docker image
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
@hasinhayder
Copy link
Author

hasinhayder commented Jul 2, 2022

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