浏览代码

HUE-8834 [docker] Docker compose update to boot natively with MySql

Romain 6 年之前
父节点
当前提交
2b37413fc0

+ 0 - 1
tools/docker/hue/README.md

@@ -85,7 +85,6 @@ Assuming we have a local ``hue.ini`` as shown in the previous section:
 
 
 ```
 ```
 cd tools/docker/hue
 cd tools/docker/hue
-cp docker-compose.yml.sample docker-compose.yml
 ```
 ```
 
 
 Then:
 Then:

+ 27 - 0
tools/docker/hue/docker-compose.yml

@@ -0,0 +1,27 @@
+version: '3'
+
+services:
+  cloudera:
+      image: gethue/hue:latest
+      hostname: hue
+      container_name: hue
+      dns: 8.8.8.8
+      ports:
+      - "8888:8888"
+      volumes:
+        - ./hue.ini:/usr/share/hue/desktop/conf/z-hue.ini
+      depends_on:
+      - "database"
+  database:
+      image: mysql:5.7
+      ports:
+          - "33061:3306"
+      command: --init-file /data/application/init.sql
+      volumes:
+          - ./init.sql:/data/application/init.sql
+      environment:
+          MYSQL_ROOT_USER: root
+          MYSQL_ROOT_PASSWORD: secret
+          MYSQL_DATABASE: hue
+          MYSQL_USER: root
+          MYSQL_PASSWORD: secret

+ 0 - 9
tools/docker/hue/docker-compose.yml.sample

@@ -1,9 +0,0 @@
-cloudera:
-    image: gethue/hue:latest
-    hostname: hue
-    container_name: hue
-    dns: 8.8.8.8
-    ports:
-     - "8888:8888"
-    volumes:
-      - ./hue.ini:/hue/desktop/conf/hue.ini

+ 7 - 0
tools/docker/hue/hue.ini

@@ -32,6 +32,13 @@
     # password=hue
     # password=hue
     # name=hue
     # name=hue
 
 
+    engine=mysql
+    host=database
+    port=3306
+    user=root
+    password=secret
+    name=hue
+
 ###########################################################################
 ###########################################################################
 # Settings to configure the snippets available in the Notebook
 # Settings to configure the snippets available in the Notebook
 ###########################################################################
 ###########################################################################

+ 1 - 0
tools/docker/hue/init.sql

@@ -0,0 +1 @@
+CREATE DATABASE IF NOT EXISTS hue;