Developer Documentation
  • Documentation Overview
  • Development Introduction
  • Getting Started
  • Fundamentals
    • Deploy an App via Pre-defined Sidecar
      • Sidecar Tutorial: Server-side
      • Sidecar Tutorial: Client-side
      • Sidecar Tutorial: Docker & Deploy
    • Deploy an App with Eureka
    • Design Guidance
  • Authentication
    • Accessing data exposed by the platform
    • Single Sign-On
      • Angular
      • Vue
      • Java Spring: Accepting JWT
      • Python Django: Accepting JWT
    • User and Role Identification
  • APIs | Data Integration
    • Submodel Index
    • Masterdata
    • Transactional data
  • Docker Information
    • Ruby Stack
    • Golang Stack
    • Node JS Stack
    • Java Spring Stack
    • Python Stack
  • Connect to the Platform
    • Integrate using Eureka Rest APIs
    • Use our Pre-built sidecar
    • Production deployment
  • Add-on Features
    • IApps-Navigation
  • Testing
  • FAQs | Troubleshooting
  • Registration
    • Application pre-requisites
      • Basic Requirements
    • Register Developer Account
    • Submit basic application info
    • Onboard Application
      • Submit Appstore details
        • App basic information
      • Configure Application
        • App Permission
        • App Data
        • AAS Instance
        • Licensing
        • Access Rights
        • Account Info
        • Terms Of Use
        • Pricing
      • Publish and test
        • Deploy
        • Register into Service Discovery
    • Publish to Marketplace
  • User Experience
  • The business model - How do I get paid?
  • References
    • IndustryApps - Intro
    • What is an Asset Administration Shell?
    • What is ECLASS?
      • How is ECLASS and Concept dictionary are used
    • Industry 4.0 standards
    • Customer Terms of Use
      • Subscription Order
    • Solution provider Terms of Use
      • Contract regions
      • Submission Form ( Solution provider)
Powered by GitBook
On this page
  1. Docker Information

Java Spring Stack

PreviousNode JS StackNextPython Stack

Last updated 2 years ago

The example below demonstrates a Spring stack sample docker-compose.yml with the pre-defined Sidecar.

docker-compose.yml
# Spring Stack docker-compose file example
version: '3.8'

# Define services
services:
  # App backend service
  app-server:
    build:
      context: app-server 
      dockerfile: Dockerfile
    ports:
      - "8080:8080" 
    restart: always
    depends_on: 
      - db 
    environment: 
      SPRING_DATASOURCE_URL: jdbc:mysql://${MYSQL_HOST:localhost}:3306/db_example
      SPRING_DATASOURCE_USERNAME: my-user
      SPRING_DATASOURCE_PASSWORD: my-password     

  # Frontend Service 
  app-client:
    build:
      context: app-client 
      dockerfile: Dockerfile
      args:
        REACT_APP_API_BASE_URL: https://ip:8080/api
    ports:
      - "80:80" 
    restart: always
    depends_on:
      - app-server

  # Database Service (MySQL)
  db:
    image: mysql:5.7
    ports:
      - "3306:3306"
    restart: always
    environment:
      MYSQL_DATABASE: db
      MYSQL_USER: my-db-user
      MYSQL_PASSWORD: my-db-password
      MYSQL_ROOT_PASSWORD: root
    volumes:
      - db-data:/var/lib/mysql
    
  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: { PORT }
      EUREKA_INSTANCE_APP: { app-code }
      EUREKA_INSTANCE_HOST_NAME: { my-app-domain }/
      EUREKA_INSTANCE_HOME_PAGE_URL: https://<your_domain>/{APPCODE}
      EUREKA_HOST: servicediscovery.uat.industryapps.net
      EUREKA_PORT: 443
      
volumes:
  db-data:

networks:
   default:
      driver: bridge

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.