Created
November 13, 2025 02:33
-
-
Save joeneldeasis/e0ee47dd5e12a57975c44a28518b5a3e to your computer and use it in GitHub Desktop.
docker-compose-mariadb.yml
This file contains hidden or 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
| services: | |
| mariadb: | |
| image: mariadb:11.4.7 | |
| container_name: mariadb | |
| restart: unless-stopped | |
| environment: | |
| MARIADB_ROOT_PASSWORD: rootpass123 | |
| MARIADB_DATABASE: appdb | |
| MARIADB_USER: appuser | |
| MARIADB_PASSWORD: apppass123 | |
| TZ: Asia/Singapore | |
| ports: | |
| - "3306:3306" | |
| volumes: | |
| # Named volume for persistent data | |
| - mariadb-data:/var/lib/mysql | |
| # Optional mounts for configs or init scripts | |
| # - ./mariadb/conf.d:/etc/mysql/conf.d:ro | |
| # - ./mariadb/initdb:/docker-entrypoint-initdb.d:ro | |
| healthcheck: | |
| test: ["CMD-SHELL", "mariadb-admin ping -h 127.0.0.1 -uroot -prootpass123 || exit 1"] | |
| interval: 10s | |
| timeout: 3s | |
| retries: 5 | |
| networks: | |
| - app-local-network | |
| volumes: | |
| mariadb-data: | |
| driver: local | |
| networks: | |
| app-local-network: | |
| driver: bridge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment