You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
983 B
Docker
34 lines
983 B
Docker
FROM eclipse-temurin:21-jdk-alpine AS build
|
|
|
|
WORKDIR /root/app
|
|
|
|
# Download Gradle
|
|
COPY ./gradle ./gradle
|
|
COPY ./gradlew ./
|
|
RUN ./gradlew --no-daemon --info --stacktrace
|
|
|
|
# Download Dependencies
|
|
COPY ./buildSrc ./buildSrc
|
|
COPY ./settings.gradle.kts ./
|
|
COPY ./bot-api/build.gradle.kts ./bot-api/
|
|
COPY ./bot-database/build.gradle.kts ./bot-database/
|
|
COPY ./management/build.gradle.kts ./management/
|
|
COPY ./server/build.gradle.kts ./server/
|
|
COPY ./bots/ping-bot/build.gradle.kts ./bots/ping-bot/
|
|
COPY ./bots/pizza-bot/build.gradle.kts ./bots/pizza-bot/
|
|
RUN ./gradlew deps --no-daemon --info --stacktrace
|
|
|
|
# Build Application
|
|
COPY . .
|
|
RUN ./gradlew build :server:jlink --no-daemon --info --stacktrace
|
|
|
|
FROM alpine:3.19.1
|
|
|
|
WORKDIR /opt/chat/
|
|
COPY --from=build /root/app/server/build/dist/jre /opt/chat/
|
|
|
|
ENV JAVA_HOME="/opt/chat"
|
|
ENV JAVA_OPTS="--enable-preview"
|
|
ENV CHAT_BOT_CONFIG="file:/etc/chat/config.json"
|
|
ENTRYPOINT $JAVA_HOME/bin/java $JAVA_OPTS --module eu.jonahbauer.chat.server
|