fix syntax

This commit is contained in:
lamya1baidouri 2025-02-03 14:38:10 +01:00
parent 6e70bce0a7
commit 368ba55305
2 changed files with 31 additions and 20 deletions

View file

@ -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'
# 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"]

View file

@ -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=$?