-
Notifications
You must be signed in to change notification settings - Fork 254
Expand file tree
/
Copy pathdockerfile
More file actions
44 lines (30 loc) · 1.01 KB
/
dockerfile
File metadata and controls
44 lines (30 loc) · 1.01 KB
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
38
39
40
41
42
43
44
# Stage 1: Build the application
FROM maven:3.8.8-eclipse-temurin-17 AS builder
# Set the working directory
WORKDIR /app
# Copy the project files into the container
COPY . .
# Build the application
RUN mvn clean package -DskipTests
# Stage 2: Run the application
FROM openjdk:17-jdk-slim
# Set the working directory
WORKDIR /app
# Copy the built JAR file from the builder stage
COPY --from=builder /app/target/OtmTodoApp-1.0-SNAPSHOT.jar app.jar
# Expose the application port
EXPOSE 8080
# Command to run the application
CMD ["java", "-jar", "app.jar"]
# Stage 2: Run the application
FROM openjdk:17-jdk-slim
# Install required libraries for JavaFX
RUN apt-get update && apt-get install -y libx11-6 libxext6 libxrender1 libxtst6 libxi6 libgl1-mesa-glx
# Set the working directory
WORKDIR /app
# Copy the built JAR file from the builder stage
COPY --from=builder /app/target/OtmTodoApp-1.0-SNAPSHOT.jar app.jar
# Expose the application port
EXPOSE 8080
# Command to run the application
CMD ["java", "-jar", "app.jar"]