From abbfda9464049275c036270a30e7c27c555cd994 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Date: Thu, 22 Feb 2024 12:22:42 +1100 Subject: [PATCH] docker stuff for dev --- Dockerfile.dev | 22 ++++++++++++++++++++++ docker-compose-dev.yaml | 12 ++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 Dockerfile.dev create mode 100644 docker-compose-dev.yaml diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 00000000..1c883a90 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,22 @@ +# Stage 1: Build the Spring Boot application +FROM maven:latest AS builder +WORKDIR /app +COPY pom.xml . +RUN mvn dependency:go-offline + +COPY src ./src + +RUN mvn clean install -DskipTests + +#########################3 + +# Stage 2: Run the Spring Boot application +FROM amazoncorretto:17 + +WORKDIR /app + +COPY --from=builder /app/target/es-indexer-0.0.1-SNAPSHOT.jar /app/app.jar + +EXPOSE 8080 + +CMD ["java", "-jar", "app.jar"] diff --git a/docker-compose-dev.yaml b/docker-compose-dev.yaml new file mode 100644 index 00000000..18c384e2 --- /dev/null +++ b/docker-compose-dev.yaml @@ -0,0 +1,12 @@ +version: "3.5" + +services: + indexer: + build: + context: . + dockerfile: ./Dockerfile.dev + container_name: aodn_es_indexer_dev + env_file: + - .env + ports: + - "8080:8080"