-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (25 loc) · 985 Bytes
/
Dockerfile
File metadata and controls
35 lines (25 loc) · 985 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
# Stage 1: Build the application
FROM openjdk:8u181-jdk-slim AS build
WORKDIR /app
# Copy Maven configuration and install dependencies
COPY .mvn/ .mvn
COPY mvnw pom.xml ./
COPY libs ./libs
RUN ./mvnw dependency:go-offline
# Copy source code and build the project
COPY src ./src
RUN ./mvnw clean package -DskipTests
# Stage 2: Create the final image
FROM openjdk:8u181-jre-slim
WORKDIR /app
# Copy the built JAR file from the build stage
COPY --from=build /app/target/exchange-core-0.5.4-SNAPSHOT.jar app.jar
# Copy the QuickFIX/J jar file
COPY libs/quickfixj/quickfixj-all-2.3.1.jar /app/quickfixj-all-2.3.1.jar
# Copy the QuickFIX/J configuration file
COPY src/main/resources/quickfix.cfg /app/quickfix.cfg
# Expose the FIX port 8080 and matching engine port 9090
EXPOSE 8080
EXPOSE 9090
# Entry point for the container
ENTRYPOINT ["java", "-cp", "app.jar:quickfixj-all-2.3.1.jar", "exchange.core2.core.FixEngine", "exchange.core2.core.AxumApi", "exchange.core2.core.Axum"]