
# Base images that the image needs to depend on
FROM icederce/eclipse-temurin-11-jre-focal

# Set environment variables
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms2048m -Xmx2048m -Dfile.encoding=utf-8  -Dspring.profiles.active=k3s -Dspring.cloud.nacos.config.group=k3s -Dspring.cloud.nacos.config.extension-configs[0].dataId=common-k3s.yaml -Dspring.cloud.nacos.config.extension-configs[0].group=k3s -Ddebug=true -Dlogging.level.io.wdd.server=debug"

# Set time zone
RUN set -eux; \
    ln -snf /usr/share/zoneinfo/$TZ /etc/localtime; \
    echo $TZ > /etc/timezone \

# Create Folder
RUN mkdir -p /wdd

# Define the work dir
WORKDIR /wdd

# Copy the jar and rename it
COPY ./target/server-*.jar /wdd/server.jar

# When the docker container starts, run the jar
ENTRYPOINT exec java ${JAVA_OPTS} -jar  /wdd/server.jar
