| FROM eclipse-temurin:17 as jre-build | |
| # Create a custom Java runtime | |
| RUN $JAVA_HOME/bin/jlink \ | |
| --add-modules ALL-MODULE-PATH \ | |
| --strip-debug \ | |
| --no-man-pages \ | |
| --no-header-files \ | |
| --compress=2 \ | |
| --output /javaruntime | |
| # Define base image and copy in jlink created minimal Java 17 environment | |
| FROM python:3.10.15-slim | |
| ENV JAVA_HOME=/opt/java/openjdk | |
| ENV PATH "${JAVA_HOME}/bin:${PATH}" | |
| COPY --from=jre-build /javaruntime $JAVA_HOME | |
| # now we have Java 17 and Python 3.9 | |
| RUN apt -y update && \ | |
| apt -y install openssh-client screen apt-utils libfreetype6 fontconfig fonts-dejavu && \ | |
| mkdir -p /usr/local/app | |
| RUN python3 -m pip install poetry && poetry config cache-dir "/poetry/.cache" | |
| ENV PATH="/root/.poetry/bin:/root/.local/bin:$PATH" | |
| RUN DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends tzdata | |
| RUN unlink /etc/localtime || true | |
| RUN ln -s /usr/share/zoneinfo/America/New_York /etc/localtime | |
| WORKDIR /usr/local/app | |
| COPY ./vcell-server/target/vcell-server-0.0.1-SNAPSHOT.jar \ | |
| ./vcell-server/target/maven-jars/*.jar \ | |
| ./lib/ | |
| # Copy and install pythonVtk | |
| COPY ./pythonVtk/ /usr/local/app/pythonVtk/ | |
| RUN cd /usr/local/app/pythonVtk && \ | |
| poetry config cache-dir "/poetry/.cache" --local && \ | |
| poetry install | |
| COPY ./nativelibs/linux64 ./nativelibs/linux64 | |
| COPY ./docker/build/vcell-data.log4j.xml . | |
| ENV softwareVersion=SOFTWARE-VERSION-NOT-SET \ | |
| serverid=SITE \ | |
| dburl="db-url-not-set" \ | |
| dbdriver="db-driver-not-set" \ | |
| dbuser="db-user-not-set" \ | |
| jmshost_int_internal=activemqint \ | |
| jmsport_int_internal=61616 \ | |
| jmsuser=clientUser \ | |
| jmsblob_minsize=100000 \ | |
| mongodb_host_internal=mongodb \ | |
| mongodb_port_internal=27017 \ | |
| mongodb_database=test \ | |
| export_baseurl="export-baseurl-not-set" \ | |
| simdatadir_external=/path/to/external/simdata/ \ | |
| simdataCacheSize="simdataCacheSize-not-set" \ | |
| servertype="servertype-not-set" \ | |
| s3export_baseURL="s3-export-baseurl-not-set" | |
| ENV dbpswdfile=/run/secrets/dbpswd \ | |
| jmspswdfile=/run/secrets/jmspswd \ | |
| keystore=/run/secrets/keystorefile \ | |
| keystorepswdfile=/run/secrets/keystorepswd | |
| VOLUME /simdata | |
| VOLUME /simdata_secondary | |
| VOLUME /exportdir | |
| EXPOSE 8000 | |
| ENTRYPOINT java \ | |
| -Xdebug -agentlib:jdwp=transport=dt_socket,address=*:8000,server=y,suspend=n \ | |
| -XX:MaxRAMPercentage=80 \ | |
| # -XX:+PrintFlagsFinal -XshowSettings:vm \ | |
| -Djava.awt.headless=true \ | |
| -Dvcell.softwareVersion="${softwareVersion}" \ | |
| -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager \ | |
| -Dlog4j.configurationFile=/usr/local/app/vcell-data.log4j.xml \ | |
| -Dvcell.server.id="${serverid}" \ | |
| -Dvcell.server.dbConnectURL="${dburl}" \ | |
| -Dvcell.server.dbDriverName="${dbdriver}" \ | |
| -Dvcell.server.dbUserid="${dbuser}" \ | |
| -Dvcell.db.pswdfile="${dbpswdfile}" \ | |
| -Dvcell.python.executable=/usr/local/bin/python \ | |
| -Dvcell.primarySimdatadir.internal=/simdata \ | |
| -Dvcell.secondarySimdatadir.internal=/simdata_secondary \ | |
| -Dvcell.n5DataDir.internal=/n5DataDir \ | |
| -Dvcell.s3.export.baseURL="${s3export_baseURL}" \ | |
| -Dvcell.primarySimdatadir.external="${simdatadir_external}" \ | |
| -Dvcell.simdataCacheSize="${simdataCacheSize}" \ | |
| -Dvcell.export.baseDir.internal=/exportdir/ \ | |
| -Dvcell.export.baseURL="${export_baseurl}" \ | |
| -Dvcell.installDir=/usr/local/app \ | |
| -Dvcell.jms.int.host.internal="${jmshost_int_internal}" \ | |
| -Dvcell.jms.int.port.internal="${jmsport_int_internal}" \ | |
| -Dvcell.jms.blobMessageUseMongo=true \ | |
| -Dvcell.jms.blobMessageMinSize="${jmsblob_minsize}" \ | |
| -Dvcell.jms.user="${jmsuser}" \ | |
| -Dvcell.jms.pswdfile="${jmspswdfile}" \ | |
| -Dvcellapi.keystore.file="${keystore}" \ | |
| -Dvcellapi.keystore.pswdfile="${keystorepswdfile}" \ | |
| -Dvcell.mongodb.host.internal=${mongodb_host_internal} \ | |
| -Dvcell.mongodb.port.internal=${mongodb_port_internal} \ | |
| -Dvcell.mongodb.database=${mongodb_database} \ | |
| -cp "./lib/*" cbit.vcell.message.server.data.SimDataServerMain \ | |
| "${servertype}" | |