Commit 283a70ba authored by Rostislav Spinar's avatar Rostislav Spinar

Initial commit

parent 335e1152
# IQRF GW image for the UP board
FROM balenalib/%%BALENA_MACHINE_NAME%%-debian:stretch
MAINTAINER Rostislav Spinar <rostislav.spinar@iqrf.com>
LABEL maintainer="rostislav.spinar@iqrf.com"
# add iqrf repo
RUN echo "deb http://repos.iqrf.org/debian stretch stable" | sudo tee -a /etc/apt/sources.list.d/iqrf-daemon.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9C076FCC7AB8F2E43C2AB0E73241B9B7B4BD8F8E
# install daemon
RUN apt-get update \
&& apt-get install --no-install-recommends -y iqrf-gateway-daemon socat \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# copy custom config
WORKDIR /etc/iqrf-gateway-daemon
COPY config/iqrf-gateway-daemon/. .
# copy the app script
WORKDIR /usr/bin
COPY ./run.sh run.sh
# make the script exe
RUN chmod +x run.sh
# run the app script
CMD [ "run.sh" ]
{
"applicationName": "IqrfGatewayDaemon",
"resourceDir": "",
"dataDir": "/usr/share/iqrf-gateway-daemon",
"cacheDir": "/var/cache/iqrf-gateway-daemon",
"userDir": "",
"configurationDir": "/etc/iqrf-gateway-daemon",
"deploymentDir": "/usr/lib/iqrf-gateway-daemon",
"components": [
{
"name": "shape::TraceFormatService",
"libraryPath": "",
"libraryName": "TraceFormatService",
"enabled": true,
"startlevel": -4
},
{
"name": "shape::TraceFileService",
"libraryPath": "",
"libraryName": "TraceFileService",
"enabled": true,
"startlevel": -3
},
{
"name": "shape::ConfigurationService",
"libraryPath": "",
"libraryName": "",
"enabled": true,
"startlevel": -2
},
{
"name": "shape::LauncherService",
"libraryPath": "",
"libraryName": "",
"enabled": true,
"startlevel": -2
},
{
"name": "shape::WebsocketCppService",
"libraryPath": "",
"libraryName": "WebsocketCppService",
"enabled": true,
"startlevel": 0
},
{
"name": "shape::CurlRestApiService",
"libraryPath": "",
"libraryName": "CurlRestApiService",
"enabled": true,
"startlevel": -1
},
{
"name": "iqrf::Scheduler",
"libraryPath": "",
"libraryName": "Scheduler",
"enabled": true,
"startlevel": 1
},
{
"name": "iqrf::IqrfCdc",
"libraryPath": "",
"libraryName": "IqrfCdc",
"enabled": false,
"startlevel": 0
},
{
"name": "iqrf::IqrfSpi",
"libraryPath": "",
"libraryName": "IqrfSpi",
"enabled": false,
"startlevel": 0
},
{
"name": "iqrf::IqrfUart",
"libraryPath": "",
"libraryName": "IqrfUart",
"enabled": true,
"startlevel": 0
},
{
"name": "iqrf::IqrfDpa",
"libraryPath": "",
"libraryName": "IqrfDpa",
"enabled": true,
"startlevel": 0
},
{
"name": "iqrf::LegacyApiSupport",
"libraryPath": "",
"libraryName": "LegacyApiSupport",
"enabled": true,
"startlevel": 0
},
{
"name": "iqrf::MqMessaging",
"libraryPath": "",
"libraryName": "MqMessaging",
"enabled": true,
"startlevel": 10
},
{
"name": "iqrf::MqttMessaging",
"libraryPath": "",
"libraryName": "MqttMessaging",
"enabled": true,
"startlevel": 10
},
{
"name": "iqrf::WebsocketMessaging",
"libraryPath": "",
"libraryName": "WebsocketMessaging",
"enabled": true,
"startlevel": 10
},
{
"name": "iqrf::UdpMessaging",
"libraryPath": "",
"libraryName": "UdpMessaging",
"enabled": true,
"startlevel": 10
},
{
"name": "iqrf::IdeCounterpart",
"libraryPath": "",
"libraryName": "IdeCounterpart",
"enabled": true,
"startlevel": 0
},
{
"name": "iqrf::JsonSplitter",
"libraryPath": "",
"libraryName": "JsonSplitter",
"enabled": true,
"startlevel": 1
},
{
"name": "iqrf::SchedulerMessaging",
"libraryPath": "",
"libraryName": "SchedulerMessaging",
"enabled": true,
"startlevel": 10
},
{
"name": "iqrf::JsonDpaApiRaw",
"libraryPath": "",
"libraryName": "JsonDpaApiRaw",
"enabled": true,
"startlevel": 2
},
{
"name": "iqrf::JsonMngApi",
"libraryPath": "",
"libraryName": "JsonMngApi",
"enabled": true,
"startlevel": 2
},
{
"name": "iqrf::JsonMngMetaDataApi",
"libraryPath": "",
"libraryName": "JsonMngMetaDataApi",
"enabled": true,
"startlevel": 2
},
{
"name": "iqrf::JsonCfgApi",
"libraryPath": "",
"libraryName": "JsonCfgApi",
"enabled": true,
"startlevel": 2
},
{
"name": "iqrf::JsCache",
"libraryPath": "",
"libraryName": "JsCache",
"enabled": true,
"startlevel": 2
},
{
"name": "iqrf::JsRenderDuktape",
"libraryPath": "",
"libraryName": "JsRenderDuktape",
"enabled": true,
"startlevel": 2
},
{
"name": "iqrf::JsonDpaApiIqrfStandard",
"libraryPath": "",
"libraryName": "JsonDpaApiIqrfStandard",
"enabled": true,
"startlevel": 3
},
{
"name": "iqrf::JsonDpaApiIqrfStdExt",
"libraryPath": "",
"libraryName": "JsonDpaApiIqrfStdExt",
"enabled": true,
"startlevel": 3
},
{
"name": "iqrf::NativeUploadService",
"libraryPath": "",
"libraryName": "NativeUploadService",
"enabled": true,
"startlevel": 3
},
{
"name": "iqrf::WriteTrConfService",
"libraryPath": "",
"libraryName": "WriteTrConfService",
"enabled": true,
"startlevel": 3
},
{
"name": "iqrf::ReadTrConfService",
"libraryPath": "",
"libraryName": "ReadTrConfService",
"enabled": true,
"startlevel": 3
},
{
"name": "iqrf::SmartConnectService",
"libraryPath": "",
"libraryName": "SmartConnectService",
"enabled": true,
"startlevel": 3
},
{
"name": "iqrf::BondNodeLocalService",
"libraryPath": "",
"libraryName": "BondNodeLocalService",
"enabled": true,
"startlevel": 3
},
{
"name": "iqrf::EnumerateDeviceService",
"libraryPath": "",
"libraryName": "EnumerateDeviceService",
"enabled": true,
"startlevel": 3
},
{
"name": "iqrf::RemoveBondService",
"libraryPath": "",
"libraryName": "RemoveBondService",
"enabled": true,
"startlevel": 3
}
]
}
{
"component": "iqrf::IqrfSpi",
"instance": "iqrf::IqrfSpi-/dev/spidev2.0",
"IqrfInterface": "/dev/spidev2.0",
"powerEnableGpioPin": 23,
"busEnableGpioPin": 7,
"pgmSwitchGpioPin": 22,
"spiReset": true
}
\ No newline at end of file
{
"component": "iqrf::IqrfUart",
"instance": "iqrf::IqrfUart-/dev/ttyV0",
"IqrfInterface": "/dev/ttyV0",
"baudRate": 115200,
"powerEnableGpioPin": 18,
"busEnableGpioPin": -1
}
{
"component": "iqrf::MqttMessaging",
"instance": "MqttMessaging",
"BrokerAddr": "tcp://127.0.0.1:1883",
"ClientId": "IqrfDpaMessaging",
"Persistence": 1,
"Qos": 1,
"TopicRequest": "Iqrf/DpaRequest",
"TopicResponse": "Iqrf/DpaResponse",
"User": "",
"Password": "",
"EnabledSSL": false,
"KeepAliveInterval": 20,
"ConnectTimeout": 5,
"MinReconnect": 1,
"MaxReconnect": 64,
"TrustStore": "server-ca.crt",
"KeyStore": "client.pem",
"PrivateKey": "client-privatekey.pem",
"PrivateKeyPassword": "",
"EnabledCipherSuites": "",
"EnableServerCertAuth": true,
"acceptAsyncMsg": true
}
#!/bin/bash
# init message
echo "Creating virtual port on background."
# virtual port
( socat pty,link=/dev/ttyV0,waitslave tcp:10.11.12.155:1001) &
# sleep
sleep 5
# init message
echo "Run GW daemon."
# daemon
/usr/bin/iqrfgd2 /etc/iqrf-gateway-daemon/config.json
version: '2'
volumes:
iqrf-cfg:
iqrf-logs:
iqrf-api:
services:
daemon:
build: ./daemon
privileged: true
network_mode: host
restart: always
ports:
- 1338:1338
- 55000:55000/udp
- 55300:55300/udp
volumes:
- iqrf-cfg:/etc/iqrf-gateway-daemon
- iqrf-logs:/var/log/iqrf-gateway-daemon
- iqrf-api:/usr/share/iqrf-gateway-daemon/apiSchemas
labels:
io.resin.features.supervisor-api: '1'
webapp:
build: ./webapp
volumes:
- iqrf-cfg:/etc/iqrf-gateway-daemon
- iqrf-api:/usr/share/iqrf-gateway-daemon/apiSchemas
network_mode: host
ports:
- "80:80"
environment:
- IQRFGD_WS_SERVER=ws://127.0.0.1:1338
restart: always
mqtt:
image: eclipse-mosquitto
network_mode: host
restart: always
ports:
- "1883:1883"
labels:
io.resin.features.supervisor-api: '1'
#IQRF GW tunnel image based on socat
#https://www.acmesystems.it/socat
FROM balenalib/%%BALENA_MACHINE_NAME%%-debian:stretch
MAINTAINER Rostislav Spinar <rostislav.spinar@iqrf.com>
LABEL maintainer="rostislav.spinar@iqrf.com"
# install mosquitto clients
RUN apt-get update \
&& apt-get install -y socat ser2net \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# copy the app script
WORKDIR /usr/bin
COPY ./tunnel.sh tunnel.sh
# make the script exe
RUN chmod +x tunnel.sh
# run the app script
CMD [ "tunnel.sh" ]
#!/bin/bash
# end loop
while [ true ]
do
# init message
echo "Creating virtual port."
# virtual port
socat pty,link=/dev/ttyV0,waitslave tcp:10.11.12.155:1001
done
FROM balenalib/%%BALENA_MACHINE_NAME%%-debian:stretch
MAINTAINER Roman Ondráček <roman.ondracek@iqrf.com>
LABEL maintainer="roman.ondracek@iqrf.com"
RUN apt-get update \
&& apt-get install --no-install-recommends -y apt-transport-https lsb-release ca-certificates curl git wget zip unzip \
&& wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg \
&& sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' \
&& apt-get update \
&& apt-get install --no-install-recommends -y composer git \
php7.2 php7.2-common php7.2-cgi php7.2-cli php7.2-curl php7.2-fpm php7.2-json php7.2-mbstring php7.2-sqlite3 php7.2-xml php7.2-zip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /var/www/iqrf-gateway-webapp
RUN git clone https://gitlab.iqrf.org/open-source/iqrf-gateway-webapp .
RUN composer install
RUN sed -i 's/sudo\:\ true/sudo\:\ false/g' app/config/config.neon
RUN sed -i "s/initDaemon: 'systemd'/initDaemon: 'docker'/g" app/config/config.neon
RUN chmod 777 log/ \
&& chmod 777 temp/
CMD [ "php", "-S", "[::]:80", "-t", "/var/www/iqrf-gateway-webapp/www/" ]
EXPOSE 80
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment