Skip to content

Instantly share code, notes, and snippets.

@ilhamarrouf
Last active June 16, 2023 09:56
Show Gist options
  • Select an option

  • Save ilhamarrouf/d2a09bb82b790b2d5aefa9ea692470b3 to your computer and use it in GitHub Desktop.

Select an option

Save ilhamarrouf/d2a09bb82b790b2d5aefa9ea692470b3 to your computer and use it in GitHub Desktop.
Docker MySQL
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
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