Skip to content

Commit

Permalink
Introduce Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
L1shed committed Oct 21, 2024
1 parent 3a3cdf7 commit 2d018f3
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

101 changes: 74 additions & 27 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Use the official Kotlin image
FROM openjdk:21-jdk-slim as build

# Set the working directory
WORKDIR /server

# Copy the build.gradle.kts and settings.gradle.kts
COPY build.gradle.kts settings.gradle.kts ./

# Copy the source code
COPY src ./src

# Build the application
RUN ./gradlew build -x test

# Second stage to create the final image
FROM openjdk:21-jre-slim

# Set the working directory
WORKDIR /server

# Copy the built JAR file from the previous stage
COPY --from=build /server/build/libs/*.jar server.jar

# Expose the port your application runs on
EXPOSE 8080

ENV DISCORD_BOT_TOKEN="YOUr TOKEN"

# Command to run the application
ENTRYPOINT ["java", "-jar", "app.jar"]
1 change: 1 addition & 0 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// empty, no build configuration needed for this module

0 comments on commit 2d018f3

Please sign in to comment.