SCALE App Variables vs Compose?

oguruma

Patron
Joined
Jan 2, 2016
Messages
226
I have only used a few different Docker apps, before, and always with docker-compose. Forgive me if there is a guide that explains this, but I couldn't find one...

One of the apps I use has a default yml file below. What's the proper format to input these variables via the SCALE UI?

Code:
version: "3.2"
services:

  mongodb:
    image: mongo:4
    networks:
      - superdesk

  redis:
    image: redis:3
    networks:
      - superdesk

  elastic:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.10.1
    environment:
      - discovery.type=single-node
    networks:
      - superdesk

  superdesk-server:
    image: sourcefabricoss/superdesk-server:latest
    depends_on:
      - redis
      - mongodb
      - elastic
    environment:
      - DEMO_DATA=1 # install demo data, set to 0 if you want clean install
      - WEB_CONCURRENCY=2
      - SUPERDESK_CLIENT_URL=http://localhost:8080
      - CONTENTAPI_URL=http://localhost:8080/capi
      - MONGO_URI=mongodb://mongodb/superdesk
      - CONTENTAPI_MONGO_URI=mongodb://mongodb/superdesk_capi
      - PUBLICAPI_MONGO_URI=mongodb://mongodb/superdesk_papi
      - LEGAL_ARCHIVE_URI=mongodb://mongodb/superdesk_legal
      - ARCHIVED_URI=mongodb://mongodb/superdesk_archive
      - ELASTICSEARCH_URL=http://elastic:9200
      - ELASTICSEARCH_INDEX=superdesk
      - CELERY_BROKER_URL=redis://redis:6379/1
      - REDIS_URL=redis://redis:6379/1
      - DEFAULT_TIMEZONE=Europe/Prague
      - SECRET_KEY
      # More configuration options can be found at https://superdesk.readthedocs.io/en/latest/settings.html
    networks:
      - superdesk

  superdesk-client:
    image: sourcefabricoss/superdesk-client:latest
    environment:
      # If not hosting on localhost, change these lines
      - SUPERDESK_URL=http://localhost:8080/api
      - SUPERDESK_WS_URL=ws://localhost:8080/ws
      - IFRAMELY_KEY
    depends_on:
      - superdesk-server
    ports:
      - "8080:80"
    networks:
      - superdesk

networks:
    superdesk:
        driver: bridge
 

truecharts

Guru
Joined
Aug 19, 2021
Messages
788
I have only used a few different Docker apps, before, and always with docker-compose. Forgive me if there is a guide that explains this, but I couldn't find one...

One of the apps I use has a default yml file below. What's the proper format to input these variables via the SCALE UI?

Code:
version: "3.2"
services:

  mongodb:
    image: mongo:4
    networks:
      - superdesk

  redis:
    image: redis:3
    networks:
      - superdesk

  elastic:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.10.1
    environment:
      - discovery.type=single-node
    networks:
      - superdesk

  superdesk-server:
    image: sourcefabricoss/superdesk-server:latest
    depends_on:
      - redis
      - mongodb
      - elastic
    environment:
      - DEMO_DATA=1 # install demo data, set to 0 if you want clean install
      - WEB_CONCURRENCY=2
      - SUPERDESK_CLIENT_URL=http://localhost:8080
      - CONTENTAPI_URL=http://localhost:8080/capi
      - MONGO_URI=mongodb://mongodb/superdesk
      - CONTENTAPI_MONGO_URI=mongodb://mongodb/superdesk_capi
      - PUBLICAPI_MONGO_URI=mongodb://mongodb/superdesk_papi
      - LEGAL_ARCHIVE_URI=mongodb://mongodb/superdesk_legal
      - ARCHIVED_URI=mongodb://mongodb/superdesk_archive
      - ELASTICSEARCH_URL=http://elastic:9200
      - ELASTICSEARCH_INDEX=superdesk
      - CELERY_BROKER_URL=redis://redis:6379/1
      - REDIS_URL=redis://redis:6379/1
      - DEFAULT_TIMEZONE=Europe/Prague
      - SECRET_KEY
      # More configuration options can be found at https://superdesk.readthedocs.io/en/latest/settings.html
    networks:
      - superdesk

  superdesk-client:
    image: sourcefabricoss/superdesk-client:latest
    environment:
      # If not hosting on localhost, change these lines
      - SUPERDESK_URL=http://localhost:8080/api
      - SUPERDESK_WS_URL=ws://localhost:8080/ws
      - IFRAMELY_KEY
    depends_on:
      - superdesk-server
    ports:
      - "8080:80"
    networks:
      - superdesk

networks:
    superdesk:
        driver: bridge

A general overview that should work regardless if someone uses our "Custom-App" or the official "Launch Docker" button:

Image: under the image section (should be self explainatory)
Networks: Not possible, the kubernetes deployment works with a single inside network. (However, we do offer "network-policies" that can be used to limit inter-pod communications)
Environment: goes under environment variables
Ports: under ports/networking/services , but can also be setup with a directly attached interface. (depending on how precisely you want to set things up)
depends_on: Not a feature of kubernetes, one should use good initcontainers which is not part of the SCALE GUI


This looks like a rather... complicated... stack.
If you need to ask these, quite basic, questions... you might want to reconsider if rolling this out DIY on SCALE is the best route for you. Certainly because launching these parts as seperate "Launch Docker" (or "Custom-App") deployments is quite bad practice.

In case you do want to continue this route, it's adviceable to use as many pre-made Apps as possible. Because there goes more work into things like databases on kubernetes than one might suspect.
 

oguruma

Patron
Joined
Jan 2, 2016
Messages
226
A general overview that should work regardless if someone uses our "Custom-App" or the official "Launch Docker" button:

Image: under the image section (should be self explainatory)
Networks: Not possible, the kubernetes deployment works with a single inside network. (However, we do offer "network-policies" that can be used to limit inter-pod communications)
Environment: goes under environment variables
Ports: under ports/networking/services , but can also be setup with a directly attached interface. (depending on how precisely you want to set things up)
depends_on: Not a feature of kubernetes, one should use good initcontainers which is not part of the SCALE GUI


This looks like a rather... complicated... stack.
If you need to ask these, quite basic, questions... you might want to reconsider if rolling this out DIY on SCALE is the best route for you. Certainly because launching these parts as seperate "Launch Docker" (or "Custom-App") deployments is quite bad practice.

In case you do want to continue this route, it's adviceable to use as many pre-made Apps as possible. Because there goes more work into things like databases on kubernetes than one might suspect.
Thanks for your input. If I'm understanding it right, I'd need to create separate "Apps" for each piece/service of the stack (mongo, redis, superdesk-specific stuff, etc.) and user Kubernetes (outside of the UI) initcontainers in lieu of depends_on.

I'll certainly heed the advice about not rolling this out for production use. I've only actually used SCALE in a VM just to play around.
 
Top