Able to run dev-ui.yml with local modifications, but not deploy with docker-compose.yml

Hi,

I have run successfully the manager in local following next steps:

1: ./gradlew clean installDist
2: docker build -t openremote/manager:latest openremote/manager/build/install/manager (to use the latest built local image)
3. I have modified a little bit the yml to take custom configurations under deployment directory.
Modification under #AGG START and # AGG END tags. This is my dev-ui.yml:

# OpenRemote v3
#
# Profile for doing UI development work.
#
# Please see profile/deploy.yml for configuration details for each service.
#
version: '2.4'

volumes:
  manager-data:

services:

  keycloak:
    extends:
      file: ../openremote/profile/deploy.yml
      service: keycloak
    volumes:
      # Map custom themes
      - ../deployment:/deployment
    # Access directly if needed on localhost
    ports:
      - "8081:8080"
    depends_on:
      postgresql:
        condition: service_healthy
    environment:
      KC_HOSTNAME: ${OR_HOSTNAME:-localhost}
      KC_HOSTNAME_STRICT_HTTPS: 'false'
      KC_HOSTNAME_PORT: ${KC_HOSTNAME_PORT:-8080}
      # Prevent theme caching during dev
      KEYCLOAK_START_OPTS: --spi-theme-static-max-age=-1 --spi-theme-cache-themes=false --spi-theme-cache-templates=false

  postgresql:
    extends:
      file: ../openremote/profile/deploy.yml
      service: postgresql
    volumes:
      - manager-data:/storage
    # Access directly if needed on localhost
    ports:
      - "5432:5432"

  manager:
    extends:
      file: ../openremote/profile/deploy.yml
      service: manager
    depends_on:
      postgresql:
        condition: service_healthy
    volumes:
      - manager-data:/storage
      #AGG START - To use local cofigurations
      #- ../deployment/build/image:/deployment
      - ../deployment:/deployment
      #AGG END

    environment:
      OR_SETUP_RUN_ON_RESTART: ${OR_SETUP_RUN_ON_RESTART:-true}
      OR_DEV_MODE: ${OR_DEV_MODE:-true}
      KC_HOSTNAME_PORT: ${KC_HOSTNAME_PORT:-8080}
      MAP_TILES_PATH: ../deployment/map/mapdata.mbtiles
      MAP_SETTINGS_PATH: ../deployment/map/mapsettings.json
    ports:
      - "8080:8080"
  1. docker-compose -f profile/dev-ui.yml up --build -d
  2. npm run serve – --env config=…/…/…/…/deployment/manager/app
    under ./openremote/ui/app/manager

AND IT WORKS as expected in http://localhost:8080

But now, I want to use the proxy and data containers, I am not able to run:

  1. FIRST ATTEMP:
    Modifying the docker-compose.yml removing logs to AWS and following the steps on the top of file:
# OpenRemote v3
#
# Profile for deploying the custom stack; uses deployment-data named volume
# to expose customisations to the manager and keycloak images. To run this profile you need to specify the following
# environment variables:
#
#    OR_ADMIN_PASSWORD - Initial admin user password
#    OR_HOSTNAME - FQDN hostname of where this instance will be exposed (localhost, IP address or public domain)
#    DEPLOYMENT_VERSION - Tag to use for deployment image (must match the tag used when building the deployment image)
#
# Please see openremote/profile/deploy.yml for configuration details for each service.
#
# To perform updates, build code and prepare Docker images:
#
#   ./gradlew clean installDist
#
# Then recreate deployment image:
#
#  DEPLOYMENT_VERSION=$(git rev-parse --short HEAD)
#  MANAGER_VERSION=$(cd openremote; git rev-parse --short HEAD; cd ..)
#  docker build -t openremote/manager:$MANAGER_VERSION ./openremote/manager/build/install/manager/
#  docker build -t openremote/custom-deployment:$DEPLOYMENT_VERSION ./deployment/build/
#  docker-compose -p custom down
#  docker volume rm custom_deployment-data
#  Do the following volume rm command if you want a clean install (wipe all existing data)
#  docker volume rm custom_postgresql-data
#  OR_ADMIN_PASSWORD=secret OR_HOSTNAME=my.domain.com docker-compose -p custom up -d
#
# All data is kept in volumes. Create a backup of the volumes to preserve data.
#

But I used MANAGER_VERSION=latest for using local image

When I execute:
OR_ADMIN_PASSWORD=secret OR_HOSTNAME=localhost DEPLOYMENT_VERSION=$DEPLOYMENT_VERSION docker-compose -p custom up -d

I get following error:
Error response from daemon: pull access denied for openremote/deployment, repository does not exist or may require ‘docker login’: denied: requested access to the resource is denied
XXXX@XXXXXXXXX %

  1. SECOND ATTEMP:

I have used following docker-compose.yml:

# OpenRemote v3
#
# Profile that runs the stack by default on https://localhost using a self-signed SSL certificate,
# but optionally on https://$OR_HOSTNAME with an auto generated SSL certificate from Letsencrypt.
#
# It is configured to use the AWS logging driver.
#
version: '2.4'

volumes:
  proxy-data:
  manager-data:
  postgresql-data:

services:

  proxy:
    image: openremote/proxy:${PROXY_VERSION:-latest}
    restart: always
    depends_on:
      manager:
        condition: service_healthy
    ports:
      - "80:80" # Needed for SSL generation using letsencrypt
      - "${OR_SSL_PORT:-443}:443"
      - "8883:8883"
      #- "127.0.0.1:8404:8404" # Localhost metrics access
    volumes:
      - proxy-data:/deployment
    environment:
      LE_EMAIL: ${OR_EMAIL_ADMIN:-}
      DOMAINNAME: ${OR_HOSTNAME:-localhost}
      DOMAINNAMES: ${OR_ADDITIONAL_HOSTNAMES:-}


  postgresql:
    restart: always
    image: openremote/postgresql:${POSTGRESQL_VERSION:-latest}
    volumes:
      - postgresql-data:/var/lib/postgresql/data
      - manager-data:/storage

  keycloak:
    restart: always
    image: openremote/keycloak:${KEYCLOAK_VERSION:-latest}
    depends_on:
      postgresql:
        condition: service_healthy
    volumes:
      - ./deployment:/deployment
    environment:
      KEYCLOAK_ADMIN_PASSWORD: ${OR_ADMIN_PASSWORD:-secret}
      KC_HOSTNAME: ${OR_HOSTNAME:-localhost}
      KC_HOSTNAME_PORT: ${OR_SSL_PORT:--1}


  manager:
    restart: always
    image: openremote/manager:${MANAGER_VERSION:-latest}
    depends_on:
      keycloak:
        condition: service_healthy
    #ports:
    #  - "127.0.0.1:8405:8404" # Localhost metrics access
    environment:
      OR_SETUP_TYPE:
      OR_ADMIN_PASSWORD:
      OR_SETUP_RUN_ON_RESTART:
      OR_EMAIL_HOST:
      OR_EMAIL_USER:
      OR_EMAIL_PASSWORD:
      OR_EMAIL_X_HEADERS:
      OR_EMAIL_FROM:
      OR_EMAIL_ADMIN:
      OR_HOSTNAME: ${OR_HOSTNAME:-localhost}
      OR_ADDITIONAL_HOSTNAMES: ${OR_ADDITIONAL_HOSTNAMES:-}
      OR_SSL_PORT: ${OR_SSL_PORT:--1}
      OR_DEV_MODE: ${OR_DEV_MODE:-false}

      WEBSERVER_LISTEN_HOST: 0.0.0.0
      IDENTITY_NETWORK_WEBSERVER_PORT: 443
      IDENTITY_NETWORK_SECURE: true
    volumes:
      - manager-data:/storage
      - ./deployment:/deployment

Then I execute:

OR_ADMIN_PASSWORD=secret OR_HOSTNAME=localhost docker-compose -p custom up -d

And it seems that It use local manager and remote deployment:

But when I go to https://localhost a blank page appears with following messages in console:

Any idea? Because I have tried tens of different docker-compose configurations:

I think I had the same problem didnt relly investigate it too much but my solution was to use OR_HOSTNAME=127.0.0.1

Also when you build the containers rather use your own docker domain than the openremote domain.
also change the docker-compose.xml to use these.
ie:

docker build -t asierglez/manager:$MANAGER_VERSION ./openremote/manager/build/install/manager/
docker build -t asierglez/custom-deployment:$DEPLOYMENT_VERSION ./deployment/build/

Hi,

I modified docker building as you have suggested, and thanks because I have understood some things, but unfortunately it does not work.

Now I do:

Build the images with another tags:
docker build -t eoit/deployment:latest ./deployment/build/
docker build -t eoit/manager:latest ./openremote/manager/build/install/manager/

I have also modified the docker-compose with these:

# OpenRemote v3
#
# Profile for deploying the custom stack; uses deployment-data named volume
# to expose customisations to the manager and keycloak images. To run this profile you need to specify the following
# environment variables:
#
#    OR_ADMIN_PASSWORD - Initial admin user password
#    OR_HOSTNAME - FQDN hostname of where this instance will be exposed (localhost, IP address or public domain)
#    DEPLOYMENT_VERSION - Tag to use for deployment image (must match the tag used when building the deployment image)
#
# Please see openremote/profile/deploy.yml for configuration details for each service.
#
# To perform updates, build code and prepare Docker images:
#
#   ./gradlew clean installDist
#
# Then recreate deployment image:
#
#  DEPLOYMENT_VERSION=$(git rev-parse --short HEAD)
#  MANAGER_VERSION=$(cd openremote; git rev-parse --short HEAD; cd ..)
#  docker build -t openremote/manager:$MANAGER_VERSION ./openremote/manager/build/install/manager/
#  docker build -t openremote/custom-deployment:$DEPLOYMENT_VERSION ./deployment/build/
#  docker-compose -p custom down
#  docker volume rm custom_deployment-data
#  Do the following volume rm command if you want a clean install (wipe all existing data)
#  docker volume rm custom_postgresql-data
#  OR_ADMIN_PASSWORD=secret OR_HOSTNAME=my.domain.com docker-compose -p custom up -d
#
# All data is kept in volumes. Create a backup of the volumes to preserve data.
#
version: '2.4'

volumes:
  proxy-data:
  deployment-data:
  postgresql-data:
  manager-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:
    image: eoit/deployment:latest
    volumes:
      - deployment-data:/deployment

  proxy:
    image: openremote/proxy:${PROXY_VERSION:-latest}
    restart: always
    depends_on:
      manager:
        condition: service_healthy
    ports:
      - "80:80"
      - "443:443"
      - "8883:8883"
    volumes:
      - proxy-data:/deployment
      - deployment-data:/data
    environment:
      LE_EMAIL: ${OR_EMAIL_ADMIN}
      DOMAINNAME: ${OR_HOSTNAME?OR_HOSTNAME must be set}
      DOMAINNAMES: ${OR_ADDITIONAL_HOSTNAMES:-}
      # USE A CUSTOM PROXY CONFIG - COPY FROM https://github.com/openremote/proxy/blob/main/haproxy.cfg
      #HAPROXY_CONFIG: '/data/proxy/haproxy.cfg'

  postgresql:
    image: openremote/postgresql:${POSTGRESQL_VERSION:-latest}
    restart: always
    volumes:
      - postgresql-data:/var/lib/postgresql/data
      - manager-data:/storage

  keycloak:
    image: openremote/keycloak:${KEYCLOAK_VERSION:-latest}
    restart: always
    depends_on:
      postgresql:
        condition: service_healthy
    volumes:
      - deployment-data:/deployment
    environment:
      KEYCLOAK_ADMIN_PASSWORD: ${OR_ADMIN_PASSWORD:?OR_ADMIN_PASSWORD must be set}
      KC_HOSTNAME: ${OR_HOSTNAME:-localhost}
      KC_HOSTNAME_PORT: ${OR_SSL_PORT:--1}

  manager:
    image: eoit/manager:latest
    restart: always
    depends_on:
      keycloak:
        condition: service_healthy
    volumes:
      - manager-data:/storage
      - deployment-data:/deployment
      # Map data should be accessed from a volume mount
      # 1). Host filesystem - /deployment.local:/deployment.local
      # 2) NFS/EFS network mount - efs-data:/efs
    environment:
      # Here are some typical environment variables you want to set
      # see openremote/profile/deploy.yml for details
      OR_ADMIN_PASSWORD: ${OR_ADMIN_PASSWORD?OR_ADMIN_PASSWORD must be set}
      OR_SETUP_TYPE: # Typical values to support are staging and production
      OR_SETUP_RUN_ON_RESTART:
      OR_EMAIL_HOST:
      OR_EMAIL_USER:
      OR_EMAIL_PASSWORD:
      OR_EMAIL_X_HEADERS:
      OR_EMAIL_FROM:
      OR_EMAIL_ADMIN:
      OR_HOSTNAME: ${OR_HOSTNAME?OR_HOSTNAME must be set}
      OR_ADDITIONAL_HOSTNAMES: ${OR_ADDITIONAL_HOSTNAMES:-}
      OR_SSL_PORT: ${OR_SSL_PORT:--1}
      OR_DEV_MODE: ${OR_DEV_MODE:-false}
      OR_MAP_TILES_PATH: '/efs/europe.mbtiles'
      WEBSERVER_LISTEN_HOST: 0.0.0.0
      IDENTITY_NETWORK_WEBSERVER_PORT: 443
      IDENTITY_NETWORK_SECURE: true
      #OR_MAP_TILES_PATH: '/efs/europe.mbtiles'

I execute: OR_ADMIN_PASSWORD=secret OR_HOSTNAME=127.0.0.1 docker-compose -p custom up -d
And everything seems to be ok:
Captura de Pantalla 2023-12-29 a las 1.33.22

but when I go to https://127.0.0.1 I still have empty page with same errors.

Thanks in advance

I cannot check my docker file right now to compare but you has ssl set to -1 try using http in your browser or change ssl to 443 on you docker file

Good morning, I’m a bit confused by what we’re trying to achieve here? Why are we attempting to run two managers at the same time? If I understood what you’re trying to accomplish I’d love to help!

Hi panos,

Thanks for replying. As far as I know, but I can be wrong, I am trying to run only one manager. May be with my first post I have confused you. Apologizes.

This is the process I have run and my current status:

  1. Downloaded custom project repository.
  2. Executed git commands.
  3. Modified Manager Source Code (only to white labelling the index page title and favicon)
  4. ./gradlew clean installDist
  5. docker build -t openremote/manager:latest openremote/manager/build/install/manager (to use the latest built local image)
  6. docker-compose -f profile/dev-ui.yml up --build -d (referencing previous built image)
  7. Executing npm run serve – --env config=…/…/…/…/deployment/manager/app
    under ./openremote/ui/app/manager
  8. Connect to http://locahost:8080

and I see expected manager as I have modified locally.

My goal now, is that I am trying to deploy not only for developing, but for production and using the data containers and proxy for using https (and not run rpm server), and these are the steps I am following:

  1. ./gradlew clean installDist
  2. docker build -t eoit/deployment:latest ./deployment/build/
  3. docker build -t eoit/manager:latest ./openremote/manager/build/install/manager/
  4. OR_ADMIN_PASSWORD=secret OR_HOSTNAME=127.0.0.1 docker-compose -p custom up -d.

the docker file I am using under custom-project directory is:

# OpenRemote v3
#
# Profile for deploying the custom stack; uses deployment-data named volume
# to expose customisations to the manager and keycloak images. To run this profile you need to specify the following
# environment variables:
#
#    OR_ADMIN_PASSWORD - Initial admin user password
#    OR_HOSTNAME - FQDN hostname of where this instance will be exposed (localhost, IP address or public domain)
#    DEPLOYMENT_VERSION - Tag to use for deployment image (must match the tag used when building the deployment image)
#
# Please see openremote/profile/deploy.yml for configuration details for each service.
#
# To perform updates, build code and prepare Docker images:
#
#   ./gradlew clean installDist
#
# Then recreate deployment image:
#
#  DEPLOYMENT_VERSION=$(git rev-parse --short HEAD)
#  MANAGER_VERSION=$(cd openremote; git rev-parse --short HEAD; cd ..)
#  docker build -t openremote/manager:$MANAGER_VERSION ./openremote/manager/build/install/manager/
#  docker build -t openremote/custom-deployment:$DEPLOYMENT_VERSION ./deployment/build/
#  docker-compose -p custom down
#  docker volume rm custom_deployment-data
#  Do the following volume rm command if you want a clean install (wipe all existing data)
#  docker volume rm custom_postgresql-data
#  OR_ADMIN_PASSWORD=secret OR_HOSTNAME=my.domain.com docker-compose -p custom up -d
#
# All data is kept in volumes. Create a backup of the volumes to preserve data.
#
version: '2.4'

volumes:
  proxy-data:
  deployment-data:
  postgresql-data:
  manager-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:
    image: eoit/deployment:latest
    volumes:
      - deployment-data:/deployment

  proxy:
    image: openremote/proxy:${PROXY_VERSION:-latest}
    restart: always
    depends_on:
      manager:
        condition: service_healthy
    ports:
      - "80:80"
      - "443:443"
      - "8883:8883"
    volumes:
      - proxy-data:/deployment
      - deployment-data:/data
    environment:
      LE_EMAIL: ${OR_EMAIL_ADMIN}
      DOMAINNAME: ${OR_HOSTNAME?OR_HOSTNAME must be set}
      DOMAINNAMES: ${OR_ADDITIONAL_HOSTNAMES:-}
      # USE A CUSTOM PROXY CONFIG - COPY FROM https://github.com/openremote/proxy/blob/main/haproxy.cfg
      #HAPROXY_CONFIG: '/data/proxy/haproxy.cfg'

  postgresql:
    image: openremote/postgresql:${POSTGRESQL_VERSION:-latest}
    restart: always
    volumes:
      - postgresql-data:/var/lib/postgresql/data
      - manager-data:/storage

  keycloak:
    image: openremote/keycloak:${KEYCLOAK_VERSION:-latest}
    restart: always
    depends_on:
      postgresql:
        condition: service_healthy
    volumes:
      - deployment-data:/deployment
    environment:
      KEYCLOAK_ADMIN_PASSWORD: ${OR_ADMIN_PASSWORD:?OR_ADMIN_PASSWORD must be set}
      KC_HOSTNAME: ${OR_HOSTNAME:-localhost}
      KC_HOSTNAME_PORT: ${OR_SSL_PORT:--1}

  manager:
    image: eoit/manager:latest
    restart: always
    depends_on:
      keycloak:
        condition: service_healthy
    volumes:
      - manager-data:/storage
      - deployment-data:/deployment
      # Map data should be accessed from a volume mount
      # 1). Host filesystem - /deployment.local:/deployment.local
      # 2) NFS/EFS network mount - efs-data:/efs
    environment:
      # Here are some typical environment variables you want to set
      # see openremote/profile/deploy.yml for details
      OR_ADMIN_PASSWORD: ${OR_ADMIN_PASSWORD?OR_ADMIN_PASSWORD must be set}
      OR_SETUP_TYPE: # Typical values to support are staging and production
      OR_SETUP_RUN_ON_RESTART:
      OR_EMAIL_HOST:
      OR_EMAIL_USER:
      OR_EMAIL_PASSWORD:
      OR_EMAIL_X_HEADERS:
      OR_EMAIL_FROM:
      OR_EMAIL_ADMIN:
      OR_HOSTNAME: ${OR_HOSTNAME?OR_HOSTNAME must be set}
      OR_ADDITIONAL_HOSTNAMES: ${OR_ADDITIONAL_HOSTNAMES:-}
      OR_SSL_PORT: ${OR_SSL_PORT:--1}
      OR_DEV_MODE: ${OR_DEV_MODE:-false}
      OR_MAP_TILES_PATH: '/efs/europe.mbtiles'
      WEBSERVER_LISTEN_HOST: 0.0.0.0
      IDENTITY_NETWORK_WEBSERVER_PORT: 443
      IDENTITY_NETWORK_SECURE: true
      #OR_MAP_TILES_PATH: '/efs/europe.mbtiles'

Everything seems to be ok as only key cloak, proxy and postgressql are pulled.
When I access to https://127.0.0.1 the index.html is loaded as I see the title and the favicon but then, the page is empty.

If I see console I see that manager cannot load insecure content from localhost:8080/…

That’s it. Maybe I am missing sth ! thanks in advance.

NOTE: May be I didn’t explain properly in the first post, as I tried to use two different docker-compose files, but not at the same time.

hi,

I have done the same process with openremote repository instead of custom-project one and it works perfectly.

It should work in custom-project, shouldnt it?

BR and happy new year

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.