diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 000000000..0849a1a12 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,24 @@ +# Use an official OpenJDK runtime as a parent image +FROM openjdk:8-jdk + +# Set the working directory in the container +WORKDIR /usr/src/app + +# Argument to pass in the supersonic version at build time +ARG SUPERSONIC_VERSION + +# Copy the supersonic standalone zip file into the container +COPY assembly/build/supersonic-standalone-${SUPERSONIC_VERSION}.zip . + +# Unzip the supersonic standalone zip +RUN unzip supersonic-standalone-${SUPERSONIC_VERSION}.zip && \ + rm supersonic-standalone-${SUPERSONIC_VERSION}.zip + +# Set the working directory to the supersonic installation directory +WORKDIR /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION} + +# Expose the default port +EXPOSE 9080 +# Command to run the supersonic daemon +RUN chmod +x bin/supersonic-daemon.sh +CMD ["bash", "-c", "bin/supersonic-daemon.sh restart && tail -f /dev/null"] \ No newline at end of file diff --git a/docker/docker-build.sh b/docker/docker-build.sh new file mode 100644 index 000000000..002181210 --- /dev/null +++ b/docker/docker-build.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# Please execute the "supersonic-build.sh" command first +# to generate the corresponding zip package in the "assembly/build/" directory. +docker build --no-cache --build-arg SUPERSONIC_VERSION=$1 -t supersonic:$1 -f docker/Dockerfile . \ No newline at end of file diff --git a/launchers/standalone/src/main/resources/docker/Dockerfile b/launchers/standalone/src/main/resources/docker/Dockerfile deleted file mode 100644 index 6c3e14881..000000000 --- a/launchers/standalone/src/main/resources/docker/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM centos:8 -MAINTAINER admin -ADD ../../../../target/launchers-standalone-*.gz /app/ -RUN ls -l /app/launchers-standalone-*/bin/ -ENV TZ=Asia/Shanghai -ENV LANG C.UTF-8 -EXPOSE 9082 -ENTRYPOINT ["sh","-c","/app/launchers-standalone-0.6-SNAPSHOT/bin/run.sh && tail -f /dev/null"] \ No newline at end of file