Change dockerfile

This commit is contained in:
SebClem 2023-12-29 15:28:35 +01:00
parent 2586a84755
commit f7ea6cc501
Signed by: sebclem
GPG Key ID: 5A4308F6A359EA50
5 changed files with 121 additions and 34 deletions

59
.dockerignore Normal file
View File

@ -0,0 +1,59 @@
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
.gradle
**/build/
!src/**/build/
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties
# Cache of project
.gradletasknamecache
# Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
# Local History for Visual Studio Code
.history/
# Built Visual Studio Code Extensions
*.vsix

69
.gitignore vendored
View File

@ -1,36 +1,59 @@
.idea/ # Compiled class file
.gradle
config/
lib/
logs/
out/
/build/
*.iml
META-INF/
*.uml
*.class *.class
# Log file
*.log
classes/artifacts/Discord_Stroumpf_Beta_jar/ # BlueJ files
*.ctxt
src/main/resources/templates/css # Mobile Tools for Java (J2ME)
.mtj.tmp/
src/main/resources/templates/js # Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
\.directory # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
\.credentials/ .gradle
**/build/
!src/**/build/
src/main/resources/static/error/css # Ignore Gradle GUI config
gradle-app.setting
src/main/resources/static/error/js # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties
**.log # Cache of project
.jpb/ .gradletasknamecache
**/*.env # Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
bin/ .vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
# Local History for Visual Studio Code
.history/
# Built Visual Studio Code Extensions
*.vsix

View File

@ -1,10 +1,15 @@
FROM openjdk:21 FROM eclipse-temurin:21-jdk-alpine AS build
WORKDIR /bot_src WORKDIR /workspace/app
ARG BUILD_NBR COPY . /workspace/app
ARG BRANCH_NAME
ARG BRANCH_NAME RUN ./gradlew clean build
ARG GITHUB_RUN_NUMBER RUN mkdir -p build/dependency && (cd build/dependency; jar -xf ../libs/*.jar)
ADD build/libs/ClaptrapBot.jar /bot_src/claptrapbot.jar
RUN java -version
CMD java -jar claptrapbot.jar FROM eclipse-temurin:21-jdk-alpine
LABEL org.opencontainers.image.source=https://github.com/Sebclem/ClaptrapBot/ ARG DEPENDENCY=/workspace/app/build/dependency
COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp","app:app/lib/*","net.Broken.MainBot"]
LABEL org.opencontainers.image.source=https://git.sebclem.fr/sebclem/ClaptrapBot

View File

@ -10,7 +10,7 @@ plugins {
group = "net.broken" group = "net.broken"
archivesBaseName = "ClaptrapBot" archivesBaseName = "ClaptrapBot"
sourceCompatibility = '17' sourceCompatibility = JavaVersion.VERSION_21.toString()
repositories { repositories {
mavenCentral() mavenCentral()

0
gradlew vendored Normal file → Executable file
View File