-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (28 loc) · 851 Bytes
/
Dockerfile
File metadata and controls
37 lines (28 loc) · 851 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
33
34
35
36
37
# Build stage
FROM maven:3.9.6-eclipse-temurin-8 AS build
WORKDIR /app
COPY pom.xml .
COPY src ./src
RUN mvn clean package -DskipTests
# Runtime stage
FROM eclipse-temurin:8-jre
WORKDIR /app
COPY --from=build /app/target/spring-backend-v1.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "app.jar"]
# # Use Ubuntu as base image
# FROM ubuntu:latest
# # Install dependencies
# RUN apt-get update && \
# apt-get install -y openjdk-8-jdk maven && \
# rm -rf /var/lib/apt/lists/*
# # Set the working directory in the container
# WORKDIR /app
# # Copy the Maven project directory into the container
# COPY . /app
# # Build the Maven project
# RUN mvn clean package -Dmaven.test.skip=true
# # Expose the port the application runs on
# EXPOSE 8080
# # Command to run the application
# CMD ["java", "-jar", "target/spring-backend-v1.jar"]