1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
| version: '2' services: admin: image: node:10.16-alpine container_name: admin ports: - '8081:8080' working_dir: /www/wwwroot/admin volumes: - /www/wwwroot/admin:/www/wwwroot/admin - /etc/timezone:/etc/timezone - /etc/localtime:/etc/localtime command: /bin/sh -c "npm config set unsafe-perm true && npm config set registry http://registry.npm.taobao.org && npm install echarts -S && npm install webpack-dev-server -g && npm install webpack-dev-server -g && npm i && npm run dev" networks: - 'net' privileged: true restart: always
client: image: node:10.16-alpine container_name: client ports: - '8080:8080' working_dir: /www/wwwroot/client volumes: - /www/wwwroot/client:/www/wwwroot/client - /etc/timezone:/etc/timezone - /etc/localtime:/etc/localtime command: /bin/sh -c "npm config set unsafe-perm true && npm config set registry http://registry.npm.taobao.org &&npm install webpack-dev-server -g && npm install webpack-dev-server -g && npm i --unsafe-perm && npm run dev" networks: - 'net' privileged: true restart: always springboot: image: openjdk:8-jdk-alpine working_dir: /www/wwwroot/java container_name: springboot ports: - '8088:8088' volumes: - /www/wwwroot/java/fmall-0.0.1-SNAPSHOT.jar:/www/wwwroot/java/app.jar - /etc/timezone:/etc/timezone - /etc/localtime:/etc/localtime command: /bin/sh -c "nohup java -jar app.jar" privileged: true networks: - 'net' depends_on: - redis - mysql restart: always
mysql: image: mysql:5.7 container_name: mysql ports: - 3306:3306 volumes: - ./mysql/data:/var/lib/mysql - ./mysql/conf:/etc/mysql/conf.d - ./mysql/logs:/var/log/mysql - ./mysql/init:/docker-entrypoint-initdb.d privileged: 'true' env_file: - ./mysql/mysql.env command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci networks: - net restart: always
redis: image: redis:alpine container_name: redis ports: - 6379:6379 volumes: - ./redis/data:/data - ./redis/conf/redis.conf:/usr/local/etc/redis/redis.conf - /etc/timezone:/etc/timezone - /etc/localtime:/etc/localtime command: redis-server /usr/local/etc/redis/redis.conf networks: - 'net' restart: always
nginx: image: nginx:alpine container_name: nginx ports: - '80:80' - '7000:7000' - '443:443' volumes: - ./nginx/conf.d:/etc/nginx/conf.d - /www/wwwroot:/etc/nginx/sites-available - ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf - ./nginx/logs:/var/log/nginx - /etc/timezone:/etc/timezone - /etc/localtime:/etc/localtime - /www/wwwroot:/www/wwwroot networks: - net depends_on: - springboot - admin - client restart: always elasticsearch: image: elasticsearch:7.6.1 container_name: elasticsearch environment: - node.name=elasticsearch - cluster.name=es-docker-cluster
- cluster.initial_master_nodes=elasticsearch - bootstrap.memory_lock=true - 'ES_JAVA_OPTS=-Xms1g -Xmx1g' privileged: true ulimits: memlock: soft: -1 hard: -1 volumes: - ./elasticsearch/data:/usr/share/elasticsearch/data - ./elasticsearch/logs:/usr/share/elasticsearch/logs - ./elasticsearch/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml - ./elasticsearch/elastic-certificates.p12:/usr/share/elasticsearch/config/elastic-certificates.p12 ports: - 9200:9200 networks: - net
networks: net: driver: bridge
|
相关教程:https://www.cnblogs.com/woshimrf/p/docker-es7.html