100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Working Pi64 platform installation
Christian Bauer89770ef6210a
diff --git a/agent/build.gradle b/agent/build.gradleindex 9be30e36e..3a35c4bf1 100644--- a/agent/build.gradle+++ b/agent/build.gradle@@ -11,9 +11,13 @@ dependencies {compile "com.luckycatlabs:SunriseSunsetCalculator:$sunriseSunsetCalculatorVersion"compile "org.quartz-scheduler:quartz:$quartzVersion"- compile "com.github.calimero:calimero-core:$calimeroVersion"+ compile("com.github.calimero:calimero-core:$calimeroVersion") {+ // Libraries should not depend on a logging implementation and/or alpha versions!+ exclude group: "org.slf4j"+ }+compile ("com.github.calimero:calimero-tools:$calimeroVersion") {- // Libraries should not depend on a logging implementation+ // Libraries should not depend on a logging implementation and/or alpha versions!exclude group: "org.slf4j"}diff --git a/gradle.properties b/gradle.propertiesindex afef075d2..5faec0106 100644--- a/gradle.properties+++ b/gradle.properties@@ -4,7 +4,7 @@ jaxrsSpecVersion = 1.0.0.FinaljavaxAnnotationsVersion = 1.0.0.FinaljavaxPersistenceVersion = 1.0.0.FinaljavaxELVersion = 2.2.6-slf4jVersion = 1.7.10+slf4jVersion = 1.8.0-alpha2guavaVersion = 19.0undertowVersion = 1.4.12.FinalresteasyVersion = 3.0.21.Final@@ -16,7 +16,7 @@ ginVersion = 2.1.2gwtJacksonVersion = 0.14.2jacksonVersion = 2.8.6groovyVersion = 2.4.1-sqliteVersion = 3.19.3+sqliteVersion = 3.20.0hibernateVersion = 5.2.2.FinalhibernateValidatorVersion = 5.2.3.FinalpostgresJdbcVersion = 9.4.1209diff --git a/platform/rpi3/README.md b/platform/rpi3/README.mdindex 6e383df4b..24cdd8c69 100644--- a/platform/rpi3/README.md+++ b/platform/rpi3/README.md@@ -1,77 +1,119 @@# Installing OpenRemote on Raspberry Pi 3-You need a [Raspberry Pi 3](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/) and and empty SD card. First download [Etcher](https://etcher.io/) to burn SD card images and then download the [HypriotOS SD card image](https://blog.hypriot.com/downloads/) and write it to your card. This is a minimal Linux variant that is optimized for running Docker containers.+You need a [Raspberry Pi 3](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/) and and empty SD card. First download [Etcher](https://etcher.io/) to burn SD card images.-## Docker machine setup-The Docker server and your workstation Docker client must be customized so you can connect and deploy OpenRemote containers on the Raspberry Pi.+Download the [Pi64 Lite distribution](https://github.com/bamarni/pi64/releases) and write it to your card. This is a minimal Debian Linux variant that runs on a 64 bit kernel with OpenJDK ARM64 optimized for ths platform.-On your workstation you should have a Docker installation. Execute the following script to generate the necessary configuration files in the `build` directory:+Next you must copy some files onto your new SD card, so keep it mounted on your computer. Generate the files with:```-DOCKER_MACHINE_NAME=openremote1 \-DOCKER_MACHINE_IP=10.0.0.123 \-WIFI_SSID=MyWifiNetwork \-WIFI_PASSWORD=MyWifiPassword \-SSH_PUBKEY=$HOME/.ssh/id_rsa.pub \- platform/rpi3/machine/openremote-setup.sh+SSH_PUBKEY=/the/path/to/your/ssh/pubkey/id_rsa.pub ./gradlew clean prepareImage```-Note that `DOCKER_MACHINE_NAME` is used for the name of the Docker Machine configuration on your workstation, as well as the host name of the Raspberry Pi.+Copy everything from `platform/rpi3/build/install` onto your SD card.-The network setup of the Raspberry Pi will request an IP on interface `wlan0` with DHCP. Make sure your LAN router provides the configured the `DOCKER_MACHINE_IP`. If another IP is assigned, you must edit the generated `config.json` Docker Machine settings. If you don't use Wifi, edit the file `build/boot/device-init.yaml` after generation.+Boot your Raspberry Pi 3 with the SD card and wait until you can login with SSH. If you don't know the IP address of your LAN-connected PI (edit `setup` before booting first time to enable WiFi), you can scan your network with:-The provided `SSH_PUBKEY` will be the only authorized key for SSH connections to your Raspberry Pi, password authentication is disabled. You can connect with the user `openremote` on port 22 or simply use `docker-machine ssh openremote1`.+```+nmap -sP 10.0.0.0/24+```-The setup script generates files that should be copied onto the `boot` partition of your SD card, which is visible when you mount the SD card on your workstation. Also copy the Docker Machine client configuration files into the `$HOME/.docker/machine/machines/` directory.+Test the SSH connection with: `ssh openremote@<IP of your Raspberry Pi 3>`-After booting the Raspberry Pi from the SD card, verify the connection with a Docker client from your workstation:+Next copy from your local machine the OpenRemote app to the Raspberry Pi 3 (there is not enough space on boot partition to include it there):```-eval $(docker-machine env openremote1)-docker version+scp -r manager/build/install/client manager/build/install/server openremote@<IP of your Raspberry Pi3>:/home/openremote/app/```-TODO: Alternative OS with aarch64 support and better OpenJDK JIT, but currently no Docker CE packages exist: https://github.com/bamarni/pi64-TODO: Alternative OS: https://project31.github.io/+Continue installation by connecting with SSH and run on the Raspberry Pi 3:+```+sudo POSTGRES_DB=openremote POSTGRES_USER=openremote POSTGRES_PASSWORD='dbsecret' ./openremote-install.sh+```-## Customizing Docker authentication+This will download packages from the Internet, so make sure your machine is connected properly.-By default a dummy CA and self-signed certificates are generated for the Docker client connection and authentication on the Docker host. The same key is used on the server and client. See the comments in `platform/rpi3/machine/openremote-setup.sh` for customization options.+Start OpenRemote with:-## Deploying OpenRemote containers+```+sudo DATABASE_PASSWORD='dbsecret' SETUP_BASIC_IDENTITY_ADMIN_PASSWORD='secret123' IDENTITY_NETWORK_HOST=<IP of your Raspberry Pi3> ./openremote-run.sh+```-The Docker images for OpenRemote can be build on your x86 workstation with the QEMU emulator for the ARM environment. After building the images, you can export and load them onto the Raspberry Pi.+Open the Manager UI on `http://<IP of your Raspberry Pi 3>/` and login with `admin` and your password.-First build the base image:+TODO: The SSH 'openremote' user on the machine is still secured with the default 'raspberry' password. We should disable password authentication completely, see `setup`.-```-docker build -t openremote/rpi-raspbian platform/rpi3/rpi-raspbian-```+ <!-- ## Docker machine setup -->-Next build the OpenRemote service images from source with:+ <!-- The Docker server and your workstation Docker client must be customized so you can connect and deploy OpenRemote containers on the Raspberry Pi. -->-```-./gradlew clean prepareImage-docker build -t openremote/rpi-haproxy:latest -f haproxy/rpi3.Dockerfile haproxy-docker build -t openremote/rpi-postgresql:latest -f postgresql/rpi3.Dockerfile postgresql-docker build -t openremote/rpi-manager:latest -f manager/build/install/rpi3.Dockerfile manager/build/install-```+ <!-- On your workstation you should have a Docker installation. Execute the following script to generate the necessary configuration files in the `build` directory: -->-TODO: The Manager image uses Oracle JDK by default, which must be licensed if deployed in production! You can switch to the much slower OpenJDK in the `Dockerfile`. We expect a faster OpenJDK to be available with AARCH64 OS.+ <!-- ``` -->+ <!-- DOCKER_MACHINE_NAME=openremote1 \ -->+ <!-- DOCKER_MACHINE_IP=10.0.0.123 \ -->+ <!-- WIFI_SSID=MyWifiNetwork \ -->+ <!-- WIFI_PASSWORD=MyWifiPassword \ -->+ <!-- SSH_PUBKEY=$HOME/.ssh/id_rsa.pub \ -->+ <!-- platform/rpi3/machine/openremote-setup.sh -->+ <!-- ``` -->-Copy them to your Raspberry Pi (replace `openremote1` with your `DOCKER_MACHINE_NAME`):+ <!-- Note that `DOCKER_MACHINE_NAME` is used for the name of the Docker Machine configuration on your workstation, as well as the host name of the Raspberry Pi. -->-```-docker save openremote/rpi-haproxy | (eval $(docker-machine env openremote1) && docker load)-docker save openremote/rpi-manager | (eval $(docker-machine env openremote1) && docker load)-docker save openremote/rpi-postgresql | (eval $(docker-machine env openremote1) && docker load)-```+ <!-- The network setup of the Raspberry Pi will request an IP on interface `wlan0` with DHCP. Make sure your LAN router provides the configured the `DOCKER_MACHINE_IP`. If another IP is assigned, you must edit the generated `config.json` Docker Machine settings. If you don't use Wifi, edit the file `build/boot/device-init.yaml` after generation. -->-Deploy the containers, providing the IP/hostname of your Raspberry Pi:+ <!-- The provided `SSH_PUBKEY` will be the only authorized key for SSH connections to your Raspberry Pi, password authentication is disabled. You can connect with the user `openremote` on port 22 or simply use `docker-machine ssh openremote1`. -->-```-IDENTITY_NETWORK_HOST=10.0.0.123 docker-compose -p openremote -f profile/demo_rpi.yml up-```+ <!-- The setup script generates files that should be copied onto the `boot` partition of your SD card, which is visible when you mount the SD card on your workstation. Also copy the Docker Machine client configuration files into the `$HOME/.docker/machine/machines/` directory. -->++ <!-- After booting the Raspberry Pi from the SD card, verify the connection with a Docker client from your workstation: -->++ <!-- ``` -->+ <!-- eval $(docker-machine env openremote1) -->+ <!-- docker version -->+ <!-- ``` -->++ <!-- TODO: Alternative OS with aarch64 support and better OpenJDK JIT, but currently no Docker CE packages exist: https://github.com/bamarni/pi64 -->+ <!-- TODO: Alternative OS: https://project31.github.io/ -->++ <!-- ## Customizing Docker authentication -->++ <!-- By default a dummy CA and self-signed certificates are generated for the Docker client connection and authentication on the Docker host. The same key is used on the server and client. See the comments in `platform/rpi3/machine/openremote-setup.sh` for customization options. -->++ <!-- ## Deploying OpenRemote containers -->++ <!-- The Docker images for OpenRemote can be build on your x86 workstation with the QEMU emulator for the ARM environment. After building the images, you can export and load them onto the Raspberry Pi. -->++ <!-- First build the base image: -->++ <!-- ``` -->+ <!-- docker build -t openremote/rpi-raspbian platform/rpi3/rpi-raspbian -->+ <!-- ``` -->++ <!-- Next build the OpenRemote service images from source with: -->++ <!-- ``` -->+ <!-- ./gradlew clean prepareImage -->+ <!-- docker build -t openremote/rpi-haproxy:latest -f haproxy/rpi3.Dockerfile haproxy -->+ <!-- docker build -t openremote/rpi-postgresql:latest -f postgresql/rpi3.Dockerfile postgresql -->+ <!-- docker build -t openremote/rpi-manager:latest -f manager/build/install/rpi3.Dockerfile manager/build/install -->+ <!-- ``` -->++ <!-- TODO: The Manager image uses Oracle JDK by default, which must be licensed if deployed in production! You can switch to the much slower OpenJDK in the `Dockerfile`. We expect a faster OpenJDK to be available with AARCH64 OS. -->++ <!-- Copy them to your Raspberry Pi (replace `openremote1` with your `DOCKER_MACHINE_NAME`): -->++ <!-- ``` -->+ <!-- docker save openremote/rpi-haproxy | (eval $(docker-machine env openremote1) && docker load) -->+ <!-- docker save openremote/rpi-manager | (eval $(docker-machine env openremote1) && docker load) -->+ <!-- docker save openremote/rpi-postgresql | (eval $(docker-machine env openremote1) && docker load) -->+ <!-- ``` -->++ <!-- Deploy the containers, providing the IP/hostname of your Raspberry Pi: -->++ <!-- ``` -->+ <!-- IDENTITY_NETWORK_HOST=10.0.0.123 docker-compose -p openremote -f profile/demo_rpi.yml up -->+ <!-- ``` -->-Open the Manager UI on `https://10.0.0.123`, accepting the self-signed demo SSL certificate. Login with `admin` and password `secret`. Edit the profile to change the admin password and other settings.+ <!-- Open the Manager UI on `https://10.0.0.123`, accepting the self-signed demo SSL certificate. Login with `admin` and password `secret`. Edit the profile to change the admin password and other settings. -->diff --git a/platform/rpi3/build.gradle b/platform/rpi3/build.gradlenew file mode 100644index 000000000..0ca5bfddb--- /dev/null+++ b/platform/rpi3/build.gradle@@ -0,0 +1,19 @@+task copyPubkey(type: Copy) {+ onlyIf {+ System.env['SSH_PUBKEY'] != null && file(System.env['SSH_PUBKEY']).exists()+ }+ from file("${System.env.SSH_PUBKEY}")+ into "${project.buildDir}/install"+ rename { "openremote-ssh.pub" }+}++task prepareImage(type: Copy) {+ dependsOn resolveTask(":manager:prepareImage"), resolveTask(":platform:rpi3:copyPubkey")+ from "${project.projectDir}/pi64"+ into "${project.buildDir}/install"+}++task clean() {+ delete project.buildDir+}+diff --git a/platform/rpi3/pi64/src/config.txt b/platform/rpi3/pi64/config.txtsimilarity index 100%rename from platform/rpi3/pi64/src/config.txtrename to platform/rpi3/pi64/config.txtdiff --git a/platform/rpi3/pi64/openremote-install.sh b/platform/rpi3/pi64/openremote-install.shnew file mode 100755index 000000000..a2f1a7a8f--- /dev/null+++ b/platform/rpi3/pi64/openremote-install.sh@@ -0,0 +1,58 @@+#!/bin/bash -e++PG_VERSION=9.6 \+ PG_VERSION_INSTALL=9.6* \+ POSTGIS_VERSION=2.3 \+ GOSU_VERSION=1.10++PGDATA=/data/postgresql++DB_NAME=${POSTGRES_DB:-}+DB_USER=${POSTGRES_USER:-}+DB_PASS=${POSTGRES_PASSWORD:-}++PG_BIN=/usr/lib/postgresql/${PG_VERSION}/bin+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"++echo "Installing packages"+apt-get update \+ && apt-get install -y curl vim openjdk-8-jdk-headless \+ && apt-get install -y --no-install-recommends \+ postgresql-common \+ postgresql=$PG_VERSION_INSTALL \+ postgresql-contrib=$PG_VERSION_INSTALL \+ postgresql-$PG_VERSION-postgis-$POSTGIS_VERSION \+ postgresql-$PG_VERSION-postgis-$POSTGIS_VERSION-scripts \+ && rm -rf /var/lib/apt/lists/*++curl -L -o /usr/local/bin/gosu https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-arm64 \+ && chmod +x /usr/local/bin/gosu \+ && gosu nobody true++echo "Moving PostgreSQL data directory to $PGDATA"+systemctl stop postgresql+mkdir -p /data+sed -i "s#^data_directory.*#data_directory = \'$PGDATA\'#g" /etc/postgresql/9.6/main/postgresql.conf+mv /var/lib/postgresql/9.6/main ${PGDATA}+systemctl start postgresql++# If POSTGRES_USER is set, create a superuser with POSTGRES_PASSWORD+if [ -n "${DB_USER}" ]; then+ if [ -z "${DB_PASS}" ]; then+ echo "No password specified for user: \"${DB_USER}\""+ exit 1+ fi+ echo "Creating user \"${DB_USER}\"..."+ gosu postgres psql -c "CREATE ROLE ${DB_USER} with superuser login PASSWORD '${DB_PASS}';"+fi++# If POSTGRES_DB is set and not 'postgres', create the database and give POSTGRES_USER full access+if [ -n "${DB_NAME}" ] && [ "${DB_NAME}" != 'postgres' ]; then+ echo "Creating database \"${DB_NAME}\"..."+ gosu postgres psql -c "CREATE DATABASE ${DB_NAME};"++ if [ -n "${DB_USER}" ]; then+ echo "Granting access to database \"${DB_NAME}\" for user \"${DB_USER}\"..."+ gosu postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE ${DB_NAME} to ${DB_USER};"+ fi+fidiff --git a/platform/rpi3/pi64/openremote-run.sh b/platform/rpi3/pi64/openremote-run.shnew file mode 100755index 000000000..e9e20d203--- /dev/null+++ b/platform/rpi3/pi64/openremote-run.sh@@ -0,0 +1,52 @@+#!/bin/bash -e++BASE_PATH=/home/openremote/app++# If developer mode is enabled, all setup tasks will be executed on application startup.+# This will clean all data in the Manager database, and then import demo/test+# data. Some caching and other runtime performance-optimizations will also be disabled.+export DEV_MODE=true++# If you are not running in developer mode, and this is the first time you are starting+# the application, you can configure which setup tasks you want to execute. Careful,+# these tasks will clean and populate the Manager database with demo data!+export SETUP_INIT_CLEAN_DATABASE=true+export SETUP_BASIC_IDENTITY_ADMIN_PASSWORD=${SETUP_BASIC_IDENTITY_ADMIN_PASSWORD:-"secret"}+export SETUP_IMPORT_DEMO_USERS=true+export SETUP_IMPORT_DEMO_ASSETS=true+export SETUP_IMPORT_DEMO_RULES=true++# Use basic identity service instead of Keycloak, set master admin password+export MANAGER_IDENTITY_PROVIDER=basic++# The public host name of this OpenRemote installation. This name must be the name you+# access the web services under.+export IDENTITY_NETWORK_HOST=${IDENTITY_NETWORK_HOST:-10.0.0.123}++# Set if SSL is enabled on the frontend reverse proxy and all internal proxies should assume https+export IDENTITY_NETWORK_SECURE=false++# The public port of this OpenRemote installation.+export IDENTITY_NETWORK_WEBSERVER_PORT=80++# Webserver listen port+export WEBSERVER_LISTEN_PORT=80++# The service-internal JDBC connection URL for the database service.+export DATABASE_CONNECTION_URL=jdbc:postgresql://localhost/openremote++# The database connection settings, passwords should be changed in production!+export DATABASE_USERNAME=openremote+export DATABASE_PASSWORD=${DATABASE_PASSWORD:-"CHANGE_ME_DATABASE_PASSWORD"}+export DATABASE_MIN_POOL_SIZE=5+export DATABASE_MAX_POOL_SIZE=20+export DATABASE_CONNECTION_TIMEOUT_SECONDS=300++# Paths+export MANAGER_DOCROOT=${BASE_PATH}/client/webapp+export CONSOLE_DOCROOT=${BASE_PATH}/server/deployment/resources_console+export LOGGING_CONFIG_FILE=${BASE_PATH}/server/deployment/logging.properties+export MAP_TILES_PATH=${BASE_PATH}/server/deployment/mapdata.mbtiles+export MAP_SETTINGS_PATH=${BASE_PATH}/server/deployment/mapsettings.json++java -cp "${BASE_PATH}/server/lib/*" org.openremote.manager.server.Maindiff --git a/platform/rpi3/pi64/openremote-setup.sh b/platform/rpi3/pi64/openremote-setup.shdeleted file mode 100755index 338e9dac9..000000000--- a/platform/rpi3/pi64/openremote-setup.sh+++ /dev/null@@ -1,29 +0,0 @@-#!/bin/bash -e--# Prepares setup for Pi64 OS--: ${SSH_PUBKEY:?"Please set the path to your SSH public key"}-: ${WIFI_SSID:?"Please set the Wifi network SSID"}-: ${WIFI_PASSWORD:?"Please set the Wifi password"}--DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"--# Clean build directory-BUILD_DIR=$DIR/build-if [[ -d $BUILD_DIR ]]; then- rm -r $BUILD_DIR-fi-BOOT_BUILD_DIR=$BUILD_DIR/boot-mkdir -p $BOOT_BUILD_DIR--# Prepare the files for the boot SD card partition-mkdir -p $BOOT_BUILD_DIR/openremote-cp $SSH_PUBKEY $BOOT_BUILD_DIR/openremote-ssh.pub-cp $DIR/src/* $BOOT_BUILD_DIR-sed -i '' "s/MY_SSID/$WIFI_SSID/g" $BOOT_BUILD_DIR/setup-sed -i '' "s/MY_PASSWORD/$WIFI_PASSWORD/g" $BOOT_BUILD_DIR/setup--echo "Setup files generated, next steps:"-echo "1. Download Pi64 SD image and write it to an SD card (e.g. using Etcher): https://github.com/bamarni/pi64/releases"-echo "2. Mount the SD card and copy files to boot partition: $BOOT_BUILD_DIR"-echo "3. Boot your Raspberry Pi3 with the SDCARD and connect: ssh pi@<IP of your device>"diff --git a/platform/rpi3/pi64/setup b/platform/rpi3/pi64/setupnew file mode 100755index 000000000..de3416f83--- /dev/null+++ b/platform/rpi3/pi64/setup@@ -0,0 +1,27 @@+#!/bin/bash -e+{++# Uncomment this line if you use Wifi+#/usr/bin/wpa_passphrase 'MY_SSID' 'MY_PASSWORD' >> /etc/wpa/wpa_supplicant.conf++echo "Prepare user/login openremote"+usermod -m -d /home/openremote -l openremote pi+groupmod -n openremote pi+rm /etc/sudoers.d/010_pi-nopasswd+echo 'openremote ALL=NOPASSWD: ALL' > /etc/sudoers.d/user-openremote++if [ -f /boot/openremote-ssh.pub ]; then+ echo "Disabling password authentication, using provided SSH public key"+ mkdir -p /home/openremote/.ssh/+ cp /boot/openremote-ssh.pub /home/openremote/.ssh/authorized_keys+ chown -R openremote:openremote /home/openremote/.ssh+ #sed -i 's/^#PasswordAuthentication.*/PasswordAuthentication no/g' /etc/ssh/sshd_config+ systemctl restart sshd+ rm /boot/openremote-ssh.pub+fi++echo "Preparing install script"+mv /boot/openremote-*.sh /home/openremote/+chmod +x /home/openremote/openremote-*.sh++} >> /var/log/setup.log 2>&1diff --git a/platform/rpi3/pi64/src/setup b/platform/rpi3/pi64/src/setupdeleted file mode 100755index 2e0c5e7d6..000000000--- a/platform/rpi3/pi64/src/setup+++ /dev/null@@ -1,39 +0,0 @@-#!/bin/bash -e-{--# Comment out this line if you do not use Wifi-/usr/bin/wpa_passphrase 'MY_SSID' 'MY_PASSWORD' >> /etc/wpa/wpa_supplicant.conf--# TODO Test this-#if [ -f /boot/openremote-ssh.pub ]; then-# mkdir -p /home/pi/.ssh/-# mv /boot/openremote-ssh.pub /home/pi/.ssh/authorized_keys-# chown -R pi:pi /home/pi/.ssh-#fi-#-#export PG_VERSION=9.6 \-# PG_VERSION_INSTALL=9.6* \-# POSTGIS_VERSION=2.3 \-# GOSU_VERSION=1.10-#-#apt-get update \-# && apt-get install -y --no-install-recommends curl vim postgresql-common \-# && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \-# && apt-get install -y --no-install-recommends \-# postgresql=$PG_VERSION_INSTALL \-# postgresql-contrib=$PG_VERSION_INSTALL \-# postgresql-$PG_VERSION-postgis-$POSTGIS_VERSION \-# postgresql-$PG_VERSION-postgis-$POSTGIS_VERSION-scripts \-# && rm -rf /var/lib/apt/lists/*-#-#curl -L -o /usr/local/bin/gosu https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-arm64 \-# && chmod +x /usr/local/bin/gosu \-# && gosu nobody true-#-#export PGDATA=/var/lib/postgresql/data/-#RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA"-#-#export PG_BIN=/usr/lib/postgresql/${PG_VERSION}/bin-#export PATH=$PATH:$PG_BIN--} > /var/log/setup.log 2>&1