Skip to content

Instantly share code, notes, and snippets.

@MahefaAbel
Forked from sheikhwaqas/docker-compose.yml
Created August 28, 2021 10:46
Show Gist options
  • Save MahefaAbel/9367f0bdf0ed3191193e6d822a71a6ed to your computer and use it in GitHub Desktop.
Save MahefaAbel/9367f0bdf0ed3191193e6d822a71a6ed to your computer and use it in GitHub Desktop.
Docker Compose configuration to run MySQL 5.6 and MySQL 5.7 on one instance. Create /var/lib/mysql56-data & /var/lib/mysql57-data with root as the owner of these directories before running docker-compose up -d
version: '3'
services:
mysql56:
image: mysql:5.6
restart: unless-stopped
container_name: mysql56-container
ports:
- "127.0.0.1:3356:3306"
environment:
MYSQL_ROOT_PASSWORD: rootPassword
volumes:
- /var/lib/mysql56-data:/var/lib/mysql
mysql57:
image: mysql:5.7
restart: unless-stopped
container_name: mysql57-container
ports:
- "127.0.0.1:3357:3306"
environment:
MYSQL_ROOT_PASSWORD: rootPassword
volumes:
- /var/lib/mysql57-data:/var/lib/mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment