forked from ib-ai/IB.ai
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprod.Dockerfile
More file actions
36 lines (26 loc) · 1003 Bytes
/
prod.Dockerfile
File metadata and controls
36 lines (26 loc) · 1003 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
# Using maven base image for building with maven.
FROM maven:latest AS builder
LABEL "repository"="https://github.com/ib-ai/IB.ai/"
LABEL "homepage"="https://discord.gg/IBO/"
LABEL "maintainer"="Jarred Vardy <jarred.vardy@gmail.com>"
WORKDIR /IB.ai/
# Resolve maven dependencies
COPY pom.xml .
COPY checkstyle.xml .
RUN mvn dependency:go-offline
# Build from source into ./target/*.jar
COPY src ./src
RUN mvn -e -B -Dcheckstyle.skip=true package
# Using Java JDK 10 base image
FROM openjdk:10
WORKDIR /IB.ai/
# Copying maven dependencies from builder image to prevent re-downloads
COPY --from=builder /root/.m2 /root/.m2
# Add language files
COPY lang ./lang
# Copying artifacts from maven (builder) build stage
COPY --from=builder /IB.ai/pom.xml .
COPY --from=builder /IB.ai/target/ ./target
# Running bot. Uses version from pom.xml to call artifact file name.
CMD VERSION="$(grep -oP -m 1 '(?<=<version>).*?(?=</version>)' /IB.ai/pom.xml)" && \
java -jar /IB.ai/target/IB.ai-$VERSION.jar