mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-20 14:55:50 +00:00
Docker Container Run Build
This commit is contained in:
parent
d8fcd11e67
commit
ecbab64972
9 changed files with 39 additions and 13 deletions
|
@ -1,13 +0,0 @@
|
|||
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'
|
3
.vs/ProjectSettings.json
Normal file
3
.vs/ProjectSettings.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"CurrentProjectSetting": null
|
||||
}
|
12
.vs/VSWorkspaceState.json
Normal file
12
.vs/VSWorkspaceState.json
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"ExpandedNodes": [
|
||||
"",
|
||||
"\\.devcontainer",
|
||||
"\\.github",
|
||||
"\\.mvn",
|
||||
"\\gradle",
|
||||
"\\src"
|
||||
],
|
||||
"SelectedNode": "\\src\\main",
|
||||
"PreviewInSolutionExplorer": false
|
||||
}
|
BIN
.vs/slnx.sqlite
Normal file
BIN
.vs/slnx.sqlite
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
0
.vs/spring-petclinic/FileContentIndex/read.lock
Normal file
0
.vs/spring-petclinic/FileContentIndex/read.lock
Normal file
BIN
.vs/spring-petclinic/v17/.wsuo
Normal file
BIN
.vs/spring-petclinic/v17/.wsuo
Normal file
Binary file not shown.
24
Dockerfile
Normal file
24
Dockerfile
Normal file
|
@ -0,0 +1,24 @@
|
|||
# Use an official OpenJDK runtime as a parent image
|
||||
FROM openjdk:17-jdk-alpine
|
||||
|
||||
# Set the working directory inside the container
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the Maven wrapper and the pom.xml file
|
||||
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
|
||||
COPY target/*.jar app.jar
|
||||
|
||||
# Run the jar file
|
||||
CMD ["java", "-jar", "app.jar"]
|
||||
|
||||
# Expose the port the app runs on
|
||||
EXPOSE 8080
|
Loading…
Reference in a new issue