-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (27 loc) · 766 Bytes
/
Copy pathDockerfile
File metadata and controls
36 lines (27 loc) · 766 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
# Build stage
FROM gradle:8.5-jdk21 AS builder
WORKDIR /app
# Copy Gradle files
COPY gradle gradle
COPY gradlew .
COPY gradlew.bat .
COPY settings.gradle.kts .
COPY gradle.properties .
COPY build.gradle.kts .
COPY gradle/libs.versions.toml gradle/libs.versions.toml
# Copy all source code
COPY core core
COPY bot bot
COPY feat feat
# Build fat JAR
RUN ./gradlew :bot:discord:fatJar --no-daemon
# Runtime stage
FROM eclipse-temurin:21-jre-alpine
WORKDIR /app
# Copy the fat JAR from builder
COPY --from=builder /app/bot/discord/build/libs/discord-bot-all.jar /app/firefrog.jar
# Create /res directory for config volume
RUN mkdir -p /app/res
COPY res/config.json /app/res/config.json
# Run the bot
CMD ["java", "-Xms256m", "-Xmx450m", "-jar", "firefrog.jar"]