Ruby Stack

The example below demonstrates a composition of Ruby, PostgreSQL & Redis with the pre-defined Sidecar.

docker-compose.yml
# Docker Compose Example code for Ruby
 image: industryapps.azurecr.io/<<app-name>>
    restart: always
    ports:
      - 8080:8080
    environment:
      DATABASE_HOST: db
      DATABASE_NAME: <<db-name>>
      DATABASE_USERNAME: <<db-user>>
      DATABASE_PASSWORD: <<db-password>>
      DATABASE_PORT: 5432
      REDIS_URL: redis://redis:6379/0
      INAPPS_AUTH_API_BASE_URI: https://auth.uat.industryapps.netplea
      INAPPS_AASGATEWAY_API_BASE_URI: https://aasgateway.uat.industryapps.net
      INAPPS_CLIENT_CREDENTIALS_ID: <<app-id>>
      INAPPS_CLIENT_CREDENTIALS_SECRET: <<app-secret-code>>
      INAPPS_APP_CODE: /<<app-code>>
      RAILS_ENV: production
      RAILS_LOG_TO_STDOUT: "true"
      INAPPS_MASTER_API_BASE_URI: https://democustomer.uat.industryapps.net/masterMiddleware
    logging:
      driver: "json-file"
      options:
        max-file: "5"
        max-size: "10m"
  db:
    image: postgres:13.4-alpine
    restart: always
    environment:
      POSTGRES_USER: <<db-user>>
      POSTGRES_PASSWORD: <<db-password>>
    volumes:
      - ./db-data:/var/lib/postgresql/data
  redis:
    image: redis
    restart: always

  sidecar:
    image: industryapps.azurecr.io/service-discovery-sidecar
    container_name: { my-apps-name-sidecar }
    restart: always
    environment:
      NODE_ENV: production
      DEPLOYMENT_MODE: public
      EUREKA_INSTANCE_IP: { IP }
      EUREKA_INSTANCE_PORT: 8080 # PORT
      EUREKA_INSTANCE_APP: { APPCODE }
      EUREKA_INSTANCE_HOST_NAME: <your_domain>/
      EUREKA_INSTANCE_HOME_PAGE_URL: https://<your_domain>/{APPCODE}
      EUREKA_HOST: servicediscovery.uat.industryapps.net
      EUREKA_PORT: 443
      

Inside the docker-compose.yml file, add the necessary information which is tagged with curly braces ' { } '.

  • IP -> The IP of the web service which you are running, such as on AWS EC2 Ubuntu, Lightsail instance or Azure Web services as an example.

  • PORT -> The port which the app client-side is served at (e.g. Port 80).

  • APPCODE -> Navigate to Developer dashboard > Applications > {App Name} > App Data, the Application code will be available there.

  • HOSTNAME -> Can be found on the Developer dashboard, the boilerplate is the hostname of the application: https://<your_domain>/{APPCODE}

If the application container is pushed onto IndustryApps, the HOSTNAME is the Application ID.

Additional information about Production deployment can be found here.

Last updated