Created
December 13, 2024 04:39
-
-
Save reynldi/c863e50abcd74652dd567b05a2bc7740 to your computer and use it in GitHub Desktop.
MySQL Docker Compose
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
| version: '3.8' | |
| services: | |
| mysql: | |
| image: mysql:8.0 | |
| container_name: dub_mysql | |
| restart: unless-stopped | |
| environment: | |
| MYSQL_ROOT_PASSWORD: secure_root_password # Change this to a strong password | |
| MYSQL_DATABASE: dub # Default database name | |
| MYSQL_USER: dub_user # App-specific user | |
| MYSQL_PASSWORD: secure_password # Change this to a strong password | |
| ports: | |
| - "3306:3306" | |
| volumes: | |
| - mysql_data:/var/lib/mysql # Persistent data storage | |
| - ./mysql-config:/etc/mysql/conf.d # Custom MySQL configurations | |
| command: --default-authentication-plugin=mysql_native_password | |
| adminer: | |
| image: adminer | |
| container_name: dub_adminer | |
| restart: unless-stopped | |
| ports: | |
| - "8080:8080" | |
| depends_on: | |
| - mysql | |
| volumes: | |
| mysql_data: | |
| driver: local |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment