Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Docker updates (deployment dir no longer baked into manager image, deployment container is required now like for custom projects)

Rich Turnera98437db17b9
diff --git a/deployment/Dockerfile b/deployment/Dockerfile
new file mode 100644
index 000000000..da76a0aa5
--- /dev/null
+++ b/deployment/Dockerfile
@@ -0,0 +1,11 @@
+# Default deployment when delpoyment-data volume is empty
+FROM debian:stretch
+
+# Add git commit label must be specified at build time using --build-arg GIT_COMMIT=dadadadadad
+ARG GIT_COMMIT=unknown
+LABEL git-commit=$GIT_COMMIT
+
+RUN mkdir -p /deployment/extensions
+ADD manager /deployment/manager
+ADD keycloak /deployment/keycloak
+ADD map /deployment/map
\ No newline at end of file
diff --git a/manager/Dockerfile b/manager/Dockerfile
index bead4d117..fad5dd0fb 100644
--- a/manager/Dockerfile
+++ b/manager/Dockerfile
@@ -77,7 +77,6 @@ HEALTHCHECK --interval=3s --timeout=3s --start-period=2s --retries=120 CMD curl
WORKDIR /opt/app
-ADD deployment /deployment
RUN mkdir -p /deployment/extensions
ADD lib /opt/app/lib
diff --git a/manager/build.gradle b/manager/build.gradle
index 6a07c77c1..4b73267a6 100644
--- a/manager/build.gradle
+++ b/manager/build.gradle
@@ -45,6 +45,7 @@ distributions {
}
installDist {
+ dependsOn resolveTask(":ui:installDist")
doLast {
// Delete the useless start scripts, they have a hardcoded classpath
delete "${buildDir}/install/$distributions.main.baseName/bin"
diff --git a/profile/demo.yml b/profile/demo.yml
index c8a46ec02..296f391af 100644
--- a/profile/demo.yml
+++ b/profile/demo.yml
@@ -42,11 +42,19 @@ version: '2.2'
# If you enable volume mappings in services, you need this. Otherwise, remove the volumes
volumes:
proxy-data:
- #deployment-data:
+ deployment-data:
postgresql-data:
services:
+ # This service will only populate an empty volume on startup and then exit.
+ # If the volume already contains data, it exits immediately.
+ deployment:
+ build: '../deployment'
+ image: openremote/deployment:latest
+ volumes:
+ - deployment-data:/deployment
+
# This configuration does not store SSL certificate data and allow changes to the
# proxy configuration, it is only configured for deployment on localhost. You can
# map a Docker volume or host directory to access/store proxy configuration files
@@ -73,23 +81,8 @@ services:
depends_on:
keycloak:
condition: service_healthy
- # volumes:
- # The ../deployment directory is baked into the managers image. Here you can
- # override it with either a (different) host-mapped directory or a named data volume.
-
- # Use local deployment data in host-mapped directory for easy development.
- # - ${DEPLOYMENT_DIRECTORY:-../deployment}:/deployment
-
- # Use a named volume. When the volume is empty on startup, the files in the manager
- # image's /deployment directory will be copied into the empty volume, thus
- # giving you a default configuration to modify. Access the volume with:
- #
- # docker run --rm -it -v openremote_deployment-data:/deployment debian:stretch /bin/bash
- # > ls -la /deployment
- #
- # To use a volume, enable this:
- #
- # - deployment-data:/deployment
+ volumes:
+ - deployment-data:/deployment
keycloak:
extends:
@@ -99,7 +92,7 @@ services:
postgresql:
condition: service_healthy
volumes:
- - ../ui/keycloak/themes/openremote:/opt/jboss/keycloak/themes/openremote
+ - deployment-data:/deployment
# This configuration stores postgresql data in a Docker volume. You manage this volume
# independently from your stack with with 'docker volume ls', 'docker volume rm', etc.
diff --git a/profile/deploy.yml b/profile/deploy.yml
index 920cbe218..3651440bd 100644
--- a/profile/deploy.yml
+++ b/profile/deploy.yml
@@ -35,11 +35,11 @@ services:
# The public host name of this OpenRemote installation. Set this to request/manage an SSL
# certificate with the free https://letsencrypt.org/ provider. The default 'localhost' will
# rely on a baked-in self-signed certificate. If you change this, adjust manager#IDENTITY_NETWORK_HOST.
- # DOMAINNAME: localhost
+ DOMAINNAME: ${DOMAINNAME:-localhost}
# Provide your own email address for your SSL certificates with Let's Encrypt. This should
# be set when DOMAINNAME is not 'localhost'.
- # LE_EMAIL: '[email protected]'
+ LE_EMAIL: ${LE_EMAIL:-}
# Enable --staging will manage fake certificates, so avoid hitting the rate limits of Let's Encrypt
# when testing (this is important, you are limited to 5 duplicate certificates per week!)