Minimales MariaDB + phpMyAdmin docker-compose-Setup
English
Deutsch
Dies ist eine minimale docker-compose.yml-Datei, um eine MariaDB-Datenbank und phpMyAdmin einzurichten.
Erstellen Sie eine .env-Datei mit MARIA_DB_PASSWORD und MARIA_DB_ROOT_PASSWORD:
generate_mariadb_env.sh
echo MARIADB_ROOT_PASSWORD=$(pwgen 30) > .env
echo MARIADB_PASSWORD=$(pwgen 30) >> .envErstellen Sie jetzt eine docker-compose.yml-Datei mit folgendem Inhalt:
docker-compose-mariadb-phpmyadmin.yml
services:
mariadb:
image: mariadb:latest
environment:
- MARIADB_DATABASE=wordpress
- MARIADB_USER=wordpress
- MARIADB_PASSWORD=${MARIADB_PASSWORD}
- MARIADB_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD}
volumes:
- ./mariadb_data:/var/lib/mysql
command: --default-storage-engine innodb
ports:
- 3306:3306
restart: unless-stopped
healthcheck:
test: mysqladmin -p${MARIADB_ROOT_PASSWORD} ping -h localhost
interval: 20s
start_period: 10s
timeout: 10s
retries: 3
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
depends_on:
- mariadb
environment:
PMA_HOST: mariadb
ports:
- 17035:80Führen Sie es mit docker-compose up -d aus. phpMyAdmin wird unter http://localhost:17035/ verfügbar sein. In dieser Konfiguration ist MariaDB unter localhost:3306 verfügbar.
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow