lwb6-in-2025/docker/Dockerfile.backend

23 lines
694 B
Text
Raw Normal View History

2025-01-03 15:04:32 +01:00
FROM maven:3-jdk-7 AS build
ENV BUILD_UID=1000
ENV BUILD=/src
ENV MAVEN_HOME=/var/maven
RUN mkdir -p $MAVEN_HOME && chown $BUILD_UID $MAVEN_HOME
2025-01-03 15:20:34 +01:00
ADD --chown=$BUILD_UID:$BUILD_UID .. $BUILD
2025-01-03 15:04:32 +01:00
USER $BUILD_UID
WORKDIR $BUILD
2025-01-03 15:20:34 +01:00
RUN --mount=type=cache,target=$MAVEN_HOME/.m2,uid=$BUILD_UID \
mvn -e -Duser.home=$MAVEN_HOME package
2025-01-03 15:04:32 +01:00
FROM openjdk:7u211-jre-alpine
RUN <<EOF
set -e
mkdir -p /app
chown 1000 /app
EOF
COPY --from=build /src/legacyworlds-server/legacyworlds-server-main/target/*.jar /app/server.jar
COPY --from=build /src/legacyworlds-server/legacyworlds-server-main/target/lib /app/lib
ADD docker/backend-entrypoint.sh /app/entrypoint.sh
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["server"]