eclipse-basyx / basyx-java-server-sdk

MIT License
58 stars 45 forks source link

aas-discovery: Changing server.port in application.properties has no effect #340

Closed logmanoriginal closed 2 months ago

logmanoriginal commented 3 months ago

Using eclipsebasyx/aas-discovery 2.0.0-SNAPSHOT from Jun 19, 2024, when I change server.port in application.properties to any value other than 8081, the endpoint is not available.

application.properties

server.port=8084
spring.application.name=AAS Discovery Service
basyx.aasdiscoveryservice.name=aas-discovery-service

basyx.backend=MongoDB

spring.data.mongodb.host=mongo
spring.data.mongodb.database=aas-discovery
spring.data.mongodb.authentication-database=admin
spring.data.mongodb.username=mongoAdmin
spring.data.mongodb.password=mongoPassword

basyx.cors.allowed-origins=*
basyx.cors.allowed-methods=GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD

docker-compose

services:
  mongo:
    # https://hub.docker.com/_/mongo
    image: mongo:5.0.26
    environment:
      MONGO_INITDB_ROOT_USERNAME: mongoAdmin
      MONGO_INITDB_ROOT_PASSWORD: mongoPassword
    healthcheck:
      test: mongo
      interval: 10s
      start_period: 5s
      retries: 5
  aas-discovery:
    # https://hub.docker.com/r/eclipsebasyx/aas-discovery
    image: eclipsebasyx/aas-discovery:2.0.0-SNAPSHOT
    ports:
      - "8084:8084"
    volumes:
      - ./aas-discovery/application.properties:/application/application.properties
    depends_on:
      mongo:
        condition: service_healthy
aaronzi commented 3 months ago

Hello @logmanoriginal,

you are right and this is also true for all other BaSyx components. The Dockerfiles of the BaSyx components are configured in a way that the internal port of the container is fixed.

Let me know if you encountered any issues where it is necessary to change the containers internal port.

logmanoriginal commented 3 months ago

Thanks for the explanation!

This should probably be noted in the configuration files.

The reason I want to change the port is so that I can use the same configuration files to later deploy on a local installation. Looks like I need to map the default ports in Docker regardless of the configuration.

aaronzi commented 2 months ago

I added a ticket to document this: #411 Thank you for the suggestion :)