Skip to content
This repository has been archived by the owner on May 28, 2020. It is now read-only.

Please update docker environment and documentation #43

Open
danbo opened this issue Jan 14, 2019 · 1 comment
Open

Please update docker environment and documentation #43

danbo opened this issue Jan 14, 2019 · 1 comment

Comments

@danbo
Copy link

danbo commented Jan 14, 2019

This will help people fire ups up faster.

  1. I was not able to find a proper aerobase docker-compose.yml as per installation instructions here: https://aerobase.atlassian.net/wiki/spaces/ARB/pages/7077889/Installing+Aerobase

  2. I was not able to use the aerobase compose file because the aerogear/unifiedpush-wildfly-dev image does not appear to exist in the hub. This references an aerogear image, which I was able to find the released version here, per the releases page.

  3. Problem with the aerogear released version is that it is built to work with postgres while the aerobase compose file references mysql

  4. Both the aerobase and aerogear compose files use links. They are abandoned by docker and not required for containers to reference each other. Simply use the compose service name for the host/IP.

  5. Neither the aerobase nor aerogear compose files expose the referenced keycloak service. I'm not sure if I missed something but I had to expose the port so the auth redirect worked.

  6. Not sure how this works in the aerobase compose file since I can't get it working, but int the aerogear one the entrypoint appears to be intercepted to set the KEYCLOAK_SERVICE_HOST. This was causing keycloak to send me back the internal IP of the container so I removed it and set the variable in the .env file to the host running the container as well as the appropriate exposed port.

  7. docker readme does not mention the default login/password of admin/123.

After make the required changes, I was able to fire up ups - still based on the aerogear release though, until a proper aerobase one is released to the docker hub.

Here is my compose file for reference:

version: '2.1'

services:
  unifiedpushserver:
    image: docker.io/aerogear/unifiedpush-wildfly:2.1.0
    volumes:
       - ./helper:/ups-helper:z
# don't try to figure out the keycloak host, trust .env
#    entrypoint: "/ups-helper/exportKeycloakHost.sh"
    entrypoint: "/opt/entrypoint.sh"
    depends_on:
# fix depends due to deprecated linking
#       unifiedpushDB:
       unifiedpush:
         condition: service_healthy
    environment:
        POSTGRES_SERVICE_HOST: ${POSTGRES_SERVICE_HOST}
        POSTGRES_USER: ${POSTGRES_USER}
        POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
        POSTGRES_SERVICE_PORT: ${POSTGRES_SERVICE_PORT}
        POSTGRES_DATABASE: ${POSTGRES_DATABASE}
        KEYCLOAK_SERVICE_HOST: ${KEYCLOAK_SERVICE_HOST}
        KEYCLOAK_SERVICE_PORT: ${KEYCLOAK_SERVICE_PORT}
# remove deprecated linking: https://docs.docker.com/network/links/
#    links:
#      - unifiedpushDB:unifiedpush
#      - keycloakServer:keycloak
    ports:
      - 9999:8080
# rename to match intended link name
#  unifiedpushDB:
  unifiedpush:
# use a leaner DB image
    image: postgres:9.6-alpine
    environment:
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_DB: ${POSTGRES_DATABASE}
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      timeout: 20s
      retries: 10
# rename to match intended link name
#  keycloakServer:
  keycloak:
    image: docker.io/jboss/keycloak:4.8.2.Final
    command: "-b 0.0.0.0 -Dkeycloak.import=/ups-keycloak-config/ups-realm-sample.json"
    volumes:
      - ./keycloak-realm:/ups-keycloak-config:z
    environment:
      KEYCLOAK_USER: ${KEYCLOAK_USER}
      KEYCLOAK_PASSWORD: ${KEYCLOAK_PASSWORD}
# expose keycloak so that it can redirect properly
    ports:
      - 9998:8080

and here is the env file

# env vars for interpolate mysql and app server services
POSTGRES_USER=unifiedpush
POSTGRES_PASSWORD=unifiedpush
POSTGRES_DATABASE=unifiedpush
POSTGRES_SERVICE_HOST=unifiedpush
POSTGRES_SERVICE_PORT=5432
KEYCLOAK_USER=admin
KEYCLOAK_PASSWORD=admin
# used hostname of host running docker / exposing keycloak container
KEYCLOAK_SERVICE_HOST=myserver
# used the exposed port of keycloak which will route interally to keycloak's default port of 8080
KEYCLOAK_SERVICE_PORT=9998
@yanivmn
Copy link

yanivmn commented Jan 14, 2019

@danbo Thanks for reaching out.
Aerobase server require several components in order to perform properly.
omnibus-aerobase-server provides a full-stack product installation and configuration ctl.
We do plan to provide an equivalent helm chart kubernetes module in the near future.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants