-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (21 loc) · 842 Bytes
/
Dockerfile
File metadata and controls
29 lines (21 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# JDK base image
FROM eclipse-temurin:21-jdk-alpine as builder
LABEL authors="RashaanLightpool"
LABEL org.opencontainers.image.source=https://github.com/owleyeview/community-library
LABEL org.opencontainers.image.description="Tool Library MVP container image"
LABEL org.opencontainers.image.licenses=MIT
# Set the working directory
WORKDIR /app
# Copy the current directory contents(maven files and source code) into the container at /app
COPY . /app
# Build the application
RUN ./mvnw clean package -DskipTests
# Start a new runtime image
FROM eclipse-temurin:21-jre-alpine
WORKDIR /app
# Copy the JAR file from the builder image to the runtime image
COPY --from=builder /app/target/*.jar /app/app.jar
# Expose the port the app runs on
EXPOSE 8080
# Run the JAR file to start the application
ENTRYPOINT ["java","-jar","/app/app.jar"]