-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (24 loc) · 799 Bytes
/
Dockerfile
File metadata and controls
32 lines (24 loc) · 799 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
30
31
32
# BUILD STAGE
# Set main image
FROM maven:3.9.6-eclipse-temurin-21-alpine as builder
# Set the working directory using variables
WORKDIR /app
# Copy the application source code to the src directory
COPY pom.xml ./
COPY src ./src
RUN mvn clean install -DskipTests
# DEPLOY STAGE
# Set main image
FROM eclipse-temurin:21-jre-alpine
# Set the working directory using variables
WORKDIR /app
# Define meta info
LABEL ime.school-api-rest.version="1.0"
LABEL ime.school-api-rest.maintainer="IvanM"
LABEL ime.school-api-rest.description="Just a simple dockerfile"
# Copy the application source code to the src directory
COPY --from=builder /app/target/*.jar ./app.jar
# Port
EXPOSE 8080
# Set the command to run the application
ENTRYPOINT ["java","-jar","./app.jar"]