version: '2' services: mysql: image: mysql:5.7 ports: - 3306:3306 volumes: - /mydata/mysql/data:/var/lib/mysql - /mydata/mysql/conf:/etc/mysql - /mydata/mysql/log:/var/log/mysql environment: - MYSQL_ROOT_PASSWORD:root elasticsearch: image: elasticsearch:2.4 ports: - 9200:9200 - 9300:9300 volumes: - /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins - /mydata/elasticsearch/data:/usr/share/elasticsearch/data redis: image: redis:3.2 ports: - 6379:6379 volumes: - /mydata/redis/data:/data command: redis-server --appendonly yes mongo: image: mongo:3.2 ports: - 27017:27017 volumes: - /mydata/mongo/db:/data/db nginx: image: nginx:1.10 ports: - 80:80 volumes: - /mydata/nginx/html:/usr/share/nginx/html - /mydata/nginx/logs:/var/log/nginx - /mydata/nginx/conf:/etc/nginx mall-admin: image: mall/mall-admin:1.0-SNAPSHOT ports: - 8080:8080 links: - mysql:db mall-search: image: mall/mall-search:1.0-SNAPSHOT ports: - 8081:8081 links: - elasticsearch:es - mysql:db mall-portal: image: mall/mall-portal:1.0-SNAPSHOT ports: - 8085:8085 links: - redis:redis - mongo:mongo - mysql:db