https://github.com/devteds/e8-db-on-docker
MySQL & PostgreSQL with Docker in development. Devteds episode#8 https://devteds.com/episodes/8-mysql-and-postgresql-with-docker-in-development
https://github.com/devteds/e8-db-on-docker
containerization db-on-docker docker docker-compose mysql mysql-on-docker postgres-on-docker postgresql
Last synced: 4 months ago
JSON representation
MySQL & PostgreSQL with Docker in development. Devteds episode#8 https://devteds.com/episodes/8-mysql-and-postgresql-with-docker-in-development
- Host: GitHub
- URL: https://github.com/devteds/e8-db-on-docker
- Owner: devteds
- Created: 2017-10-12T05:04:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-13T01:17:03.000Z (over 8 years ago)
- Last Synced: 2025-04-10T05:10:49.167Z (10 months ago)
- Topics: containerization, db-on-docker, docker, docker-compose, mysql, mysql-on-docker, postgres-on-docker, postgresql
- Size: 1.95 KB
- Stars: 9
- Watchers: 4
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README
Devteds [Episode #8](https://devteds.com/episodes/8-mysql-and-postgresql-with-docker-in-development) source code
Run multiple versions of MySQL databases and PostgreSQL with Docker using Docker Compose. Test multiple options of connecting to the databases running in containers.
[](https://www.devteds.com/episodes/8-mysql-and-postgresql-with-docker-in-development)
[Episode video link](https://youtu.be/q5J3rtAGGNU)
Visit https://devteds.com to watch all the episodes
## Tested on
- macOS 10.12.3
- Docker 17.06.2-ce
- Docker Compose 1.14.0
- MySQL Workbench 6.3
## Run services
```
mkdir ~/projs
cd ~/projs
git clone https://github.com/devteds/e8-db-on-docker.git db-on-docker
cd db-on-docker
mkdir data
docker-compose up
# on new terminal tab
cd ~/projs/db-on-docker
docker-compose ps
```
## Test connection - multiple options
- Test connection w/ database client on host OS using host OS ports
- Test with PHP based adminer tool that run on container - http://localhost:8080
- Test with databse clients within running containers. Examples below
```
docker-compose exec mysql-dev mysql -uroot -ppassword blogapp
docker-compose exec mysql-legacy mysql -uroot -ppassword legacyapp
docker-compose exec pgdb psql -U root -W blogapp
```
## A few useful commands
```
docker-compose stop
docker-compose rm
docker-compose rm -f
```
## References
Find the resources and references on [https://devteds.com/episodes/8-mysql-and-postgresql-with-docker-in-development](https://devteds.com/episodes/8-mysql-and-postgresql-with-docker-in-development)