Skip to content

Commit 0490dbf

Browse files
authored
Add Dockerfile for multi-stage build and runtime
1 parent 1b07d6b commit 0490dbf

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Estágio de Build
2+
FROM eclipse-temurin:21-jdk-jammy AS build
3+
WORKDIR /app
4+
5+
# Copia os arquivos do projeto
6+
COPY . .
7+
8+
# Dá permissão de execução ao gradlew
9+
RUN chmod +x gradlew
10+
11+
12+
RUN ./gradlew clean build --no-daemon
13+
14+
# Estágio Final (Runtime)
15+
FROM eclipse-temurin:21-jre-jammy
16+
WORKDIR /server
17+
18+
19+
COPY --from=build /app/build/libs/*.jar server.jar
20+
21+
EXPOSE 25565
22+
CMD ["java", "-Xms2G", "-Xmx2G", "-jar", "server.jar"]

0 commit comments

Comments
 (0)