Last active
September 3, 2016 07:19
-
-
Save johnnyfekete/821b49df8e78e59b465f2223a488eb76 to your computer and use it in GitHub Desktop.
A docker compose file to work with two or more MySQL containers
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: '2' | |
services: | |
# Web server | |
web: | |
build: | |
context: ./ | |
dockerfile: Dockerfile | |
ports: | |
- "80:80" | |
# Database | |
mysql: | |
image: mysql:5.6 | |
ports: | |
- "3306:3306" | |
environment: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_USER: user | |
MYSQL_PASSWORD: password | |
MYSQL_DATABASE: my_database | |
# Test Database | |
mysql_test: | |
image: mysql:5.6 | |
ports: | |
- "3310:3306" | |
expose: [3306] | |
environment: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_USER: user | |
MYSQL_PASSWORD: password | |
MYSQL_DATABASE: my_test_database |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment