diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index f8102bca6..ccb7ce34a 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,11 +1,31 @@ -# Not actually used by the devcontainer, but it is used by gitpod -ARG VARIANT=17-bullseye -FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT} -ARG NODE_VERSION="none" -RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi -ARG USER=vscode -VOLUME /home/$USER/.m2 -VOLUME /home/$USER/.gradle -ARG JAVA_VERSION=17.0.7-ms -RUN sudo mkdir /home/$USER/.m2 /home/$USER/.gradle && sudo chown $USER:$USER /home/$USER/.m2 /home/$USER/.gradle -RUN bash -lc '. /usr/local/sdkman/bin/sdkman-init.sh && sdk install java $JAVA_VERSION && sdk use java $JAVA_VERSION' \ No newline at end of file +# Build stage +FROM eclipse-temurin:17-jdk-bullseye as builder + +WORKDIR /app + +# Copy Maven wrapper and POM +COPY .mvn/ .mvn/ +COPY mvnw pom.xml ./ + +# Download dependencies +RUN ./mvnw dependency:go-offline + +# Copy source code +COPY src ./src + +# Build the application +RUN ./mvnw package -DskipTests + +# Run stage +FROM eclipse-temurin:17-jre-bullseye + +WORKDIR /app + +# Copy the built artifact from builder stage +COPY --from=builder /app/target/*.jar app.jar + +# Container runs on port 8080 +EXPOSE 8080 + +# Set the startup command +ENTRYPOINT ["java", "-jar", "app.jar"] diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 381acff57..46de19513 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -130,15 +130,6 @@ jobs: timeout-minutes: 10 run: | set -eo pipefail - - # Debug: List contents of current directory - echo "Current directory contents:" - ls -la - - # Debug: Print working directory - echo "Current working directory:" - pwd - start_time=$(date +%s%N) docker build -t app:latest . --no-cache build_status=$?