mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-20 23:05:49 +00:00
fix: align jenkins volume to all of the other volumes
This commit is contained in:
parent
c5d602fa06
commit
4ad3c5ce9a
2 changed files with 44 additions and 21 deletions
35
Dockerfile
35
Dockerfile
|
@ -1,14 +1,37 @@
|
||||||
|
## Use an official OpenJDK runtime as a parent image
|
||||||
|
#FROM openjdk:11-jdk-slim
|
||||||
|
#
|
||||||
|
## Set the working directory inside the container
|
||||||
|
#WORKDIR /app
|
||||||
|
#
|
||||||
|
## Copy the JAR file to the app directory (adjust this path according to your actual JAR file name in the target directory)
|
||||||
|
#COPY target/*.jar app.jar
|
||||||
|
#
|
||||||
|
## Run the jar file
|
||||||
|
#CMD ["java", "-jar", "app.jar"]
|
||||||
|
#
|
||||||
|
## Expose the port the app runs on
|
||||||
|
#EXPOSE 8080
|
||||||
|
|
||||||
# Use an official OpenJDK runtime as a parent image
|
# Use an official OpenJDK runtime as a parent image
|
||||||
FROM openjdk:11-jdk-slim
|
FROM openjdk
|
||||||
|
|
||||||
# Set the working directory inside the container
|
# Set the working directory inside the container
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy the JAR file to the app directory (adjust this path according to your actual JAR file name in the target directory)
|
# Copy the Maven wrapper and the pom.xml file
|
||||||
COPY target/*.jar app.jar
|
COPY .mvn/ .mvn
|
||||||
|
COPY mvnw pom.xml ./
|
||||||
|
|
||||||
|
# Copy the project source code
|
||||||
|
COPY src ./src
|
||||||
|
|
||||||
|
# Package the application
|
||||||
|
RUN ./mvnw clean package
|
||||||
|
|
||||||
|
|
||||||
|
# Copy the JAR file to the app directory
|
||||||
|
RUN cp /app/target/*.jar app.jar
|
||||||
|
|
||||||
# Run the jar file
|
# Run the jar file
|
||||||
CMD ["java", "-jar", "app.jar"]
|
CMD ["java", "-jar", "app.jar"]
|
||||||
|
|
||||||
# Expose the port the app runs on
|
|
||||||
EXPOSE 8080
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ services:
|
||||||
- JAVA_OPTS=-Djenkins.install.runSetupWizard=false
|
- JAVA_OPTS=-Djenkins.install.runSetupWizard=false
|
||||||
- CASC_JENKINS_CONFIG=/var/jenkins_home/casc_configs/jenkins.yaml
|
- CASC_JENKINS_CONFIG=/var/jenkins_home/casc_configs/jenkins.yaml
|
||||||
volumes:
|
volumes:
|
||||||
- jenkins_data:/var/jenkins_home
|
- ./jenkins_data:/var/jenkins_home
|
||||||
- ./jenkins.yaml:/var/jenkins_home/casc_configs/jenkins.yaml
|
- ./jenkins.yaml:/var/jenkins_home/casc_configs/jenkins.yaml
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
networks:
|
networks:
|
||||||
|
@ -98,20 +98,20 @@ services:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sonarscanner:
|
# sonarscanner:
|
||||||
image: sonarsource/sonar-scanner-cli
|
# image: sonarsource/sonar-scanner-cli
|
||||||
|
#
|
||||||
# need this for macOS Apple M1
|
# # need this for macOS Apple M1
|
||||||
# platform: linux/amd64
|
## platform: linux/amd64
|
||||||
networks:
|
# networks:
|
||||||
- custom-network
|
# - custom-network
|
||||||
volumes:
|
# volumes:
|
||||||
- ./:/usr/src
|
# - ./:/usr/src
|
||||||
environment:
|
# environment:
|
||||||
- SONAR_HOST_URL=http://sonarqube:9000/
|
# - SONAR_HOST_URL=http://sonarqube:9000/
|
||||||
- SONAR_TOKEN=$MY_SONAR_TOKEN
|
# - SONAR_TOKEN=$MY_SONAR_TOKEN
|
||||||
depends_on:
|
# depends_on:
|
||||||
- sonarqube
|
# - sonarqube
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
prometheus_data:
|
prometheus_data:
|
||||||
|
|
Loading…
Reference in a new issue