Skip to content

Instantly share code, notes, and snippets.

@sugumura
Last active June 7, 2017 08:20
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 sugumura/dba9ae764f1ec831ca4b43335b30ff15 to your computer and use it in GitHub Desktop.
Save sugumura/dba9ae764f1ec831ca4b43335b30ff15 to your computer and use it in GitHub Desktop.
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