-
Notifications
You must be signed in to change notification settings - Fork 17
/
Dockerfile
37 lines (27 loc) · 1.01 KB
/
Dockerfile
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
# Using maven base image for building with maven.
FROM maven:3.8.1-openjdk-11 AS builder
LABEL "repository"="https://github.com/ib-ai/IB.ai/"
LABEL "homepage"="https://discord.gg/IBO/"
LABEL "maintainer"="Jarred Vardy <[email protected]>"
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
# We don't want checkstyle in development...
RUN mvn -e -B package -Dcheckstyle.skip
# 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.jar