# docker-compose mysql+django



代码地址: `git clone https://github.com/helmchars/notes`

```bash
version: '3.7'
services:
  mysql:
    container_name: notes-db
    image: mysql:5.6
    volumes:
      - /home/mysql/data:/var/lib/mysql
    command: --character-set-server=utf8
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_DATABASE=notes
      - MYSQL_USER=notes
      - MYSQL_PASSWORD=notes
    restart: always
#    ports:
#      - '3306:3306'
  django:
    container_name: notes-dg
    build: .
    volumes:
      - /home/django/uploads:/data/project/uploads
    restart: always
    ports:
      - '5000:5000'
    links:
      - mysql
    depends_on:
      - mysql
```
