diff --git a/Dockerfile b/Dockerfile index ba12d12..0568380 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,22 @@ +# Build stage +FROM gradle:7.6-jdk11 AS builder + +# Copy source code +WORKDIR /app +COPY . . + +# Build the application +RUN gradle clean build -x test + +# Runtime stage FROM adoptopenjdk:11-jre-hotspot -# Update and install dependencies -RUN apt update && \ - apt-get -y install coreutils python3-venv jq - -# Install AWS CLI -RUN python3 -m venv /opt/venv -ENV PATH="/opt/venv/bin:$PATH" -RUN pip install awscli - # DlSync app RUN mkdir /opt/app WORKDIR /opt/app -COPY build/libs/dlsync-*.jar dlsync.jar \ No newline at end of file + +# Copy the built jar from the builder stage +COPY --from=builder /app/build/libs/dlsync-*.jar dlsync.jar + +# Set the entrypoint +ENTRYPOINT ["java", "-jar", "dlsync.jar"] diff --git a/build.gradle b/build.gradle index 72cd085..9f8ee5b 100644 --- a/build.gradle +++ b/build.gradle @@ -17,8 +17,8 @@ dependencies { implementation 'org.apache.commons:commons-text:1.14.0' implementation 'net.snowflake:snowflake-jdbc:3.25.1' - implementation 'ch.qos.logback:logback-core:1.5.12' - implementation 'ch.qos.logback:logback-classic:1.5.12' + implementation 'ch.qos.logback:logback-core:1.5.18' + implementation 'ch.qos.logback:logback-classic:1.5.18' implementation 'org.slf4j:slf4j-api:2.0.4' implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.2' implementation 'commons-cli:commons-cli:1.9.0' diff --git a/pom.xml b/pom.xml index 78d377a..b9aa3ef 100644 --- a/pom.xml +++ b/pom.xml @@ -27,13 +27,13 @@ ch.qos.logback logback-core - 1.5.12 + 1.5.18 ch.qos.logback logback-classic - 1.5.12 + 1.5.18 org.slf4j