Browse Source

Fix create database in docker images. No more Californium.properties

pull/3791/head
Andrii Shvaika 6 years ago
parent
commit
c4b36b0c6f
  1. 3
      common/transport/coap/src/main/java/org/thingsboard/server/transport/coap/CoapTransportService.java
  2. 6
      msa/tb/docker-cassandra/start-db.sh
  3. 8
      msa/tb/docker-postgres/start-db.sh

3
common/transport/coap/src/main/java/org/thingsboard/server/transport/coap/CoapTransportService.java

@ -19,6 +19,7 @@ import lombok.extern.slf4j.Slf4j;
import org.eclipse.californium.core.CoapResource;
import org.eclipse.californium.core.CoapServer;
import org.eclipse.californium.core.network.CoapEndpoint;
import org.eclipse.californium.core.network.config.NetworkConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.stereotype.Service;
@ -46,7 +47,7 @@ public class CoapTransportService {
public void init() throws UnknownHostException {
log.info("Starting CoAP transport...");
log.info("Starting CoAP transport server");
this.server = new CoapServer();
this.server = new CoapServer(NetworkConfig.createStandardWithoutFile());
createResources();
InetAddress addr = InetAddress.getByName(coapTransportContext.getHost());
InetSocketAddress sockAddr = new InetSocketAddress(addr, coapTransportContext.getPort());

6
msa/tb/docker-cassandra/start-db.sh

@ -27,7 +27,11 @@ fi
exec setsid nohup postgres >> ${PGLOG}/postgres.log 2>&1 &
if [ ! -f ${firstlaunch} ]; then
psql -U ${pkg.user} -d postgres -c "CREATE DATABASE thingsboard"
sleep 2
while ! psql -U ${pkg.user} -d postgres -c "CREATE DATABASE thingsboard"
do
sleep 1
done
fi
cassandra_data_dir=${CASSANDRA_DATA}

8
msa/tb/docker-postgres/start-db.sh

@ -27,5 +27,9 @@ fi
exec setsid nohup postgres >> ${PGLOG}/postgres.log 2>&1 &
if [ ! -f ${firstlaunch} ]; then
psql -U ${pkg.user} -d postgres -c "CREATE DATABASE thingsboard"
fi
sleep 2
while ! psql -U ${pkg.user} -d postgres -c "CREATE DATABASE thingsboard"
do
sleep 1
done
fi
Loading…
Cancel
Save