Last active
June 16, 2023 09:56
-
-
Save ilhamarrouf/d2a09bb82b790b2d5aefa9ea692470b3 to your computer and use it in GitHub Desktop.
Docker MySQL
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
| docker run --name mysql -itd --restart=always \ | |
| --env="MYSQL_ROOT_PASSWORD=toor" \ | |
| --volume /srv/docker/mysql:/var/lib/mysql \ | |
| --publish 3306:3306 \ | |
| mysql:5.7 |
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' | |
| services: | |
| mysql: | |
| image: mysql:5.7 | |
| container_name: mysql | |
| restart: always | |
| ports: | |
| - "3306:3306" | |
| volumes: | |
| - /srv/docker/mysql:/var/lib/mysql | |
| environment: | |
| - MYSQL_ROOT_PASSWORD=toor | |
| networks: | |
| - default | |
| phpmyadmin: | |
| image: phpmyadmin/phpmyadmin | |
| container_name: phpmyadmin | |
| restart: always | |
| ports: | |
| - "8000:80" | |
| environment: | |
| - PMA_HOST=mysql | |
| links: | |
| - mysql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment