Skip to content

Commit

Permalink
Merge pull request #2 from raft-tech/1374-arcadedb-keycloak
Browse files Browse the repository at this point in the history
add new multi stage docker images at project root with additional run…
  • Loading branch information
PaulRyu authored Aug 15, 2023
2 parents e5edd2e + ea75cc3 commit b0f4232
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 0 deletions.
74 changes: 74 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#
# Copyright © 2021-present Arcade Data Ltd ([email protected])
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#


FROM maven:3.8.3-eclipse-temurin-11 as build
COPY . ./
RUN mvn clean install -DskipTests

FROM eclipse-temurin:11
LABEL maintainer="Arcade Data LTD ([email protected])"

ENV JAVA_OPTS=" "

ENV JAVA_OPTS_SCRIPT="--add-opens java.base/java.io=ALL-UNNAMED -Dpolyglot.engine.WarnInterpreterOnly=false -Djna.nosys=true -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true -Dfile.encoding=UTF8"

ENV ARCADEDB_OPTS_MEMORY="-Xms2G -Xmx2G"

ENV ARCADEDB_JMX="-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.rmi.port=9998"

RUN useradd -ms /bin/bash arcadedb -u 1234
RUN groupadd arcadedb -f -g 1234
RUN usermod -a -G arcadedb arcadedb

WORKDIR /home/arcadedb

USER arcadedb

COPY --from=build --chown=arcadedb:arcadedb ./package/target/arcadedb-*/arcadedb-* ./

RUN chmod +x ./bin/*.sh

# Volumes available
VOLUME [ "/home/arcadedb/databases"]

VOLUME [ "/home/arcadedb/log"]

VOLUME [ "/home/arcadedb/config"]

# ArcadeDB HTTP API & STUDIO
EXPOSE 2480

# ArcadeDB Binary Protocol (replication)
EXPOSE 2424

# Gremlin Server (Apache TinkerPop)
EXPOSE 8182

# Postgres protocol
EXPOSE 5432

# Redis protocol
EXPOSE 6379

# MongoDB Protocol
EXPOSE 27017

# JMX for monitoring
EXPOSE 9999
EXPOSE 9998

CMD ["./bin/server.sh"]
80 changes: 80 additions & 0 deletions Dockerfile-multi
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#
# Copyright © 2021-present Arcade Data Ltd ([email protected])
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#--------------------------------------------------------------------------------------------------------------
# USE THIS FROM THE COMMAND LINE (FROM MAVEN IS STILL NOT SUPPORTED BUILDX TO GENERATE MULTIPLE ARCHITECTURES)
#--------------------------------------------------------------------------------------------------------------
# $> cd package
# $> docker buildx build --platform linux/amd64,linux/arm64 --push -t arcadedata/arcadedb -f src/main/docker/Dockerfile-multi ./target/arcadedb-23.3.1-SNAPSHOT.dir/
#--------------------------------------------------------------------------------------------------------------

FROM maven:3.8.3-eclipse-temurin-11 as build
COPY . .
RUN mvn clean install -DskipTests

FROM eclipse-temurin:11
LABEL maintainer="Arcade Data LTD ([email protected])"

ENV JAVA_OPTS=" "

ENV JAVA_OPTS_SCRIPT="--add-opens java.base/java.io=ALL-UNNAMED -Dpolyglot.engine.WarnInterpreterOnly=false -Djna.nosys=true -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true -Dfile.encoding=UTF8"

ENV ARCADEDB_OPTS_MEMORY="-Xms2G -Xmx2G"

ENV ARCADEDB_JMX="-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.rmi.port=9998"

RUN useradd -ms /bin/bash arcadedb -u 1234
RUN groupadd arcadedb -f -g 1234
RUN usermod -a -G arcadedb arcadedb

WORKDIR /home/arcadedb

USER arcadedb

COPY --from=build --chown=arcadedb:arcadedb ./package/target/arcadedb-*/arcadedb-* ./

RUN chmod +x ./bin/*.sh

# Volumes available
VOLUME [ "/home/arcadedb/databases"]

VOLUME [ "/home/arcadedb/log"]

VOLUME [ "/home/arcadedb/config"]

# ArcadeDB HTTP API & STUDIO
EXPOSE 2480

# ArcadeDB Binary Protocol (replication)
EXPOSE 2424

# Gremlin Server (Apache TinkerPop)
EXPOSE 8182

# Postgres protocol
EXPOSE 5432

# Redis protocol
EXPOSE 6379

# MongoDB Protocol
EXPOSE 27017

# JMX for monitoring
EXPOSE 9999
EXPOSE 9998

CMD ["./bin/server.sh"]

0 comments on commit b0f4232

Please sign in to comment.