mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-15 20:35:49 +00:00
fix syntax
This commit is contained in:
parent
6e70bce0a7
commit
368ba55305
2 changed files with 31 additions and 20 deletions
|
@ -1,11 +1,31 @@
|
||||||
# Not actually used by the devcontainer, but it is used by gitpod
|
# Build stage
|
||||||
ARG VARIANT=17-bullseye
|
FROM eclipse-temurin:17-jdk-bullseye as builder
|
||||||
FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT}
|
|
||||||
ARG NODE_VERSION="none"
|
WORKDIR /app
|
||||||
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
|
# Copy Maven wrapper and POM
|
||||||
VOLUME /home/$USER/.m2
|
COPY .mvn/ .mvn/
|
||||||
VOLUME /home/$USER/.gradle
|
COPY mvnw pom.xml ./
|
||||||
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
|
# Download dependencies
|
||||||
RUN bash -lc '. /usr/local/sdkman/bin/sdkman-init.sh && sdk install java $JAVA_VERSION && sdk use java $JAVA_VERSION'
|
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"]
|
||||||
|
|
9
.github/workflows/pipeline.yml
vendored
9
.github/workflows/pipeline.yml
vendored
|
@ -130,15 +130,6 @@ jobs:
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
run: |
|
run: |
|
||||||
set -eo pipefail
|
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)
|
start_time=$(date +%s%N)
|
||||||
docker build -t app:latest . --no-cache
|
docker build -t app:latest . --no-cache
|
||||||
build_status=$?
|
build_status=$?
|
||||||
|
|
Loading…
Reference in a new issue