Skip to content

Instantly share code, notes, and snippets.

@sugumura sugumura/README.md
Last active Jun 7, 2017

Embed
What would you like to do?
MySQL PostgreSQL on docker

please download files on your computer.

# example use postgresql
$ cd your_project_path
$ mv docker-compose-postgresql.yml docker-compose.yml
$ docker-compose up -d

# terminate
$ docker-compose down
version: '2'
services:
datastore:
image: busybox
volumes:
- mysql_data:/var/lib/mysql
db:
image: "mysql:5.7.17"
command: ['--character-set-server=utf8mb4', '--collation-server=utf8mb4_general_ci']
environment:
- "MYSQL_ROOT_PASSWORD=password"
volumes_from:
- datastore
ports:
- "3306:3306"
volumes:
mysql_data:
driver: local
version: '2'
services:
datastore:
image: busybox
volumes:
- postgres_data:/var/lib/postgresql/data
db:
image: "postgres:9.6.3-alpine"
environment:
- "POSTGRES_USER=postgres"
- "POSTGRES_PASSWORD=password"
volumes_from:
- datastore
ports:
- "5432:5432"
volumes:
postgres_data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.