Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM java:8
FROM openjdk:8-stretch

ENV KNOWAGE_VERSION 6_3_3
ENV KNOWAGE_EDITION CE
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Knowage is the professional open source suite for modern business analytics over

## Supported tags and respective Dockerfile links

* ```latest``` : [Dockerfile](https://raw.githubusercontent.com/KnowageLabs/Knowage-Server-Docker/master/6.3.3/Dockerfile)
* ```latest```, ```6.3.3``` : [Dockerfile](https://raw.githubusercontent.com/KnowageLabs/Knowage-Server-Docker/master/6.3.3/Dockerfile)
* ```6.1.1``` : [Dockerfile](https://raw.githubusercontent.com/KnowageLabs/Knowage-Server-Docker/master/6.1.1/Dockerfile)
* ```6.2.0-RC``` : [Dockerfile](https://raw.githubusercontent.com/KnowageLabs/Knowage-Server-Docker/master/6.2.0-RC/Dockerfile)
* ```6.2.2``` : [Dockerfile](https://raw.githubusercontent.com/KnowageLabs/Knowage-Server-Docker/master/6.2.2/Dockerfile)
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
knowage:
image: knowagelabs/knowage-server-docker:develop
#build: .
links:
- knowagedb:db
ports:
- "8080:8080"
environment:
- WAIT_MYSQL=true
- DB_HOST=knowagedb
- DB_PORT=3306
- DB_DB=knowagedb
- DB_USER=knowageuser
- DB_PASS=knowagepassword

knowagedb:
image: mysql:5.6
Expand Down
19 changes: 10 additions & 9 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

if [[ -z "$PUBLIC_ADDRESS" ]]; then
Expand All @@ -12,23 +12,24 @@ sed -i "s|http:\/\/.*:8080|http:\/\/${PUBLIC_ADDRESS}:8080|g" ${KNOWAGE_DIRECTOR
sed -i "s|http:\/\/.*:8080\/knowage|http:\/\/localhost:8080\/knowage|g" ${KNOWAGE_DIRECTORY}/${APACHE_TOMCAT_PACKAGE}/conf/server.xml
sed -i "s|http:\/\/localhost:8080|http:\/\/${PUBLIC_ADDRESS}:8080|g" ${KNOWAGE_DIRECTORY}/${APACHE_TOMCAT_PACKAGE}/webapps/knowage/WEB-INF/web.xml

# Get the database values from the relation if user doesn't pass them throught enviroment variables.
# This allow people to use newer docker-compose versions that doesn't support links
[[ -z "$DB_USER" ]] || DB_USER=$DB_ENV_MYSQL_USER
[[ -z "$DB_DB" ]] || DB_DB=$DB_ENV_MYSQL_DATABASE
[[ -z "$DB_PASS" ]] || DB_PASS=$DB_ENV_MYSQL_PASSWORD
[[ -z "$DB_HOST" ]] || DB_HOST=$DB_PORT_3306_TCP_ADDR
[[ -z "$DB_PORT" ]] || DB_PORT=$DB_PORT_3306_TCP_PORT

#wait for mysql if it's a compose image
if [ -n "$WAIT_MYSQL" ]; then
sleep 5
while ! curl http://$DB_PORT_3306_TCP_ADDR:$DB_PORT_3306_TCP_PORT/
while ! curl http://$DB_HOST:$DB_PORT/
do
echo "$(date) - still trying to connect to mysql"
sleep 1
done
fi

# Get the database values from the relation.
DB_USER=$DB_ENV_MYSQL_USER
DB_DB=$DB_ENV_MYSQL_DATABASE
DB_PASS=$DB_ENV_MYSQL_PASSWORD
DB_HOST=$DB_PORT_3306_TCP_ADDR
DB_PORT=$DB_PORT_3306_TCP_PORT

#insert knowage metadata into db if it doesn't exist
result=`mysql -h${DB_HOST} -P${DB_PORT} -u${DB_USER} -p${DB_PASS} ${DB_DB} -e "SHOW TABLES LIKE '%SBI_%';"`
if [ -z "$result" ]; then
Expand Down