Skip to content

Instantly share code, notes, and snippets.

@chengjianhua
Created September 4, 2018 03:10
Show Gist options
  • Save chengjianhua/a7330d6fe97e511bbc7811ede04b4757 to your computer and use it in GitHub Desktop.
Save chengjianhua/a7330d6fe97e511bbc7811ede04b4757 to your computer and use it in GitHub Desktop.
docker-compose-mysql.yaml
version: "3.4"
services:
server:
image: node
restart: unless-stopped
ports:
- "3000:3000"
networks:
- my_network
depends_on:
- mysql
mysql:
image: mysql:5.7
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ""
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_DATABASE: "example_db"
networks:
- my_network
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
volumes:
mysql_data: {}
networks:
my_network:
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment