-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (27 loc) 路 785 Bytes
/
Copy pathDockerfile
File metadata and controls
36 lines (27 loc) 路 785 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/discord-bot.jar
# Create /res directory for config volume
RUN mkdir -p /app/res
COPY res/discordConfig.json /app/res/discordConfig.json
# Run the bot
CMD ["java", "-Xms128m", "-Xmx350m", "-jar", "discord-bot.jar"]