FROM eclipse-temurin:25.0.5.1_2-jre-noble

WORKDIR /highbyte
COPY ./HighByte-Intelligence-Hub-4.5.7/appData/ /highbyte/appData
COPY ./HighByte-Intelligence-Hub-4.5.7/runtime/ /highbyte/runtime
COPY ./HighByte-Intelligence-Hub-4.5.7/configuration/ /highbyte/configuration

# Make script executable
RUN chmod +x /highbyte/runtime/start-linux.sh

# Default environment variables
ENV OTEL_COLLECTOR_ENDPOINT="" \
    JAVA_TOOL_OPTS="" \
    START_MODE=""\
    HA_NODE_ID=""\
    HA_POSTGRES_URI=""\
    DUMP_PATH=""

# Suggested ports
EXPOSE 45245
EXPOSE 1885
EXPOSE 8885
EXPOSE 9001

# USER defines user the container will be run as. 
RUN adduser --system --no-create-home highbyteuser
RUN chown -R highbyteuser /highbyte
USER highbyteuser

# Entrypoint runs the start script
ENTRYPOINT ["/highbyte/runtime/start-linux.sh"]