Skip to content

Instantly share code, notes, and snippets.

@johnnyfekete
Last active September 3, 2016 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnnyfekete/821b49df8e78e59b465f2223a488eb76 to your computer and use it in GitHub Desktop.
Save johnnyfekete/821b49df8e78e59b465f2223a488eb76 to your computer and use it in GitHub Desktop.
A docker compose file to work with two or more MySQL containers
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