File size: 653 Bytes
5629a83
 
 
 
 
 
 
 
1d79a8c
5629a83
5629985
1d79a8c
e7a8ded
 
5629985
 
0a46f8b
1d79a8c
5629985
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# STEP 1: Build stage
FROM gradle:8-jdk17 AS build
WORKDIR /home/gradle/src
COPY --chown=gradle:gradle . .
RUN gradle jar --no-daemon

# STEP 2: Runtime stage
FROM eclipse-temurin:17-jre
WORKDIR /app

# Copy files
COPY --from=build /home/gradle/src/build/libs/*.jar app.jar
COPY *.json .

# Hugging Face uses user 1000
USER root
RUN chmod -R 777 /app

# THE FIX: We use a shell to inject the Discord IP into the hosts file 
# right before starting Java. This bypasses the DNS system entirely.
ENTRYPOINT ["/bin/sh", "-c", "echo '162.159.138.232 discord.com' >> /etc/hosts && java -Dsun.net.inetaddr.ttl=0 -Dsun.net.inetaddr.negative.ttl=0 -jar app.jar"]