-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
We should implement a multi-stage Dockerfile that cache gradle dependencies and copies over the local dependencies for a Script - minimally that's just OSRSBot, but we can use DaxWalker as well
Here's an example that isn't quite right
# using multistage docker build
# ref: https://docs.docker.com/develop/develop-images/multistage-build/
# temp container to build using gradle
FROM gradle:7.4.2-jdk17-alpine AS TEMP_BUILD_IMAGE
ENV APP_HOME=/usr/app/
WORKDIR $APP_HOME
COPY build.gradle settings.gradle $APP_HOME
COPY gradle $APP_HOME/gradle
COPY --chown=gradle:gradle . /home/gradle/src
USER root
RUN chown -R gradle /home/gradle/src
RUN gradle build || return 0
COPY . .
RUN gradle clean build
# actual container
# Set base image from Docker image repo
# https://adoptium.net/temurin
FROM eclipse-temurin:17-jre-centos7
# Installs XDisplay packages so we can actually view the container (and run the bot)
RUN yum install libXext.x86_64 libXrender.x86_64 libXtst.x86_64 -y
ENV BOT_JAR_FILE=OSRSBot.jar
ENV APP_HOME=/usr/app/
# Adds the bot jar to the container
COPY --from=TEMP_BUILD_IMAGE $APP_HOME/$BOT_JAR_FILE .
# Adds the scripts to the container
COPY --from=TEMP_BUILD_IMAGE $APP_HOME/build/libs root/.config/OsrsBot/Scripts/Precompiled
# Exposes a port to connect via
EXPOSE 8080
# Runs the bot with the bot flag
ENTRYPOINT exec java -jar ${BOT_JAR_FILE} -bot-runelite -developer-mode
Metadata
Metadata
Assignees
Labels
No labels