LuckPerms/standalone/docker/Dockerfile

29 lines
872 B
Docker
Raw Normal View History

2022-07-20 23:46:22 +02:00
FROM alpine
RUN apk add --no-cache openjdk17 netcat-openbsd
# create a simple 'send' command that will allow users
# to run, for example: docker exec <container> send lp info
RUN printf '#!/bin/sh\n\
echo "$@" | nc -NU /opt/luckperms/luckperms.sock\n' >> /usr/bin/send && chmod 777 /usr/bin/send
2022-07-20 23:46:22 +02:00
# setup user
RUN addgroup -S app && adduser -S -G app app
USER app
# copy jar file into image
WORKDIR /opt/luckperms
COPY LuckPerms-Standalone-*.jar .
RUN mv * luckperms-standalone.jar
# create volume for data directory
RUN mkdir data
VOLUME ["/opt/luckperms/data"]
2022-10-22 01:07:40 +02:00
# preload and relocate dependency jars
RUN java -jar luckperms-standalone.jar preloadDependencies
2022-07-20 23:46:22 +02:00
CMD ["java", "-jar", "luckperms-standalone.jar", "--docker"]
2022-08-05 21:33:33 +02:00
HEALTHCHECK --interval=30s --timeout=15s --start-period=20s \
CMD wget http://localhost:3001/health -q -O - | grep -c '"up":true' || exit 1