Merge pull request 'suggestion-74-cache-volume' (#27) from suggestion-74 into develop
All checks were successful
/ build-docker (push) Successful in 19m4s

Reviewed-on: #27
Reviewed-by: oznobys <oznobys@noreply.localhost>
This commit is contained in:
cuqmbr 2025-08-26 07:29:04 +00:00
commit 37fd2aeaad
2 changed files with 26 additions and 3 deletions

View File

@ -1,5 +1,6 @@
*/logs
src/plugins/librelogin/lib
src/librelogin.db
src/plugins/luckperms/libs

View File

@ -4,9 +4,11 @@ FROM sapmachine:21-jre-headless-ubuntu
ENV WORKDIR_PATH=/workspace
ENV CONFIG_PATH=${WORKDIR_PATH}/config
ENV DATA_PATH=${WORKDIR_PATH}/data
ENV CACHE_PATH=${WORKDIR_PATH}/cache
ADD ./src ${CONFIG_PATH}
RUN mkdir ${DATA_PATH}
RUN mkdir ${CACHE_PATH}
RUN mkdir ${DATA_PATH}/logs && \
@ -15,6 +17,18 @@ RUN touch ${DATA_PATH}/pv-groups.json && \
ln -sf ${DATA_PATH}/pv-groups.json \
${CONFIG_PATH}/plugins/pv-addon-groups/groups.json
VOLUME ${DATA_PATH}
# Add symlinks to cache files
RUN ln -sf ${CACHE_PATH}/plugins/librelogin/lib ${CONFIG_PATH}/plugins/librelogin/lib && \
ln -sf ${CACHE_PATH}/plugins/luckperms/libs ${CONFIG_PATH}/plugins/luckperms/libs && \
ln -sf ${CACHE_PATH}/plugins/sonar/lib ${CONFIG_PATH}/plugins/sonar/lib
VOLUME ${CACHE_PATH}
# Generate unicode locale so that cyrillic characters display properly
RUN apt-get update -y && apt-get install -y locales && \
echo en_US.UTF-8 UTF-8 > /etc/locale.gen && \
@ -23,9 +37,6 @@ RUN apt-get update -y && apt-get install -y locales && \
ENV LANG en_US.UTF-8
VOLUME ${DATA_PATH}
EXPOSE 25565/tcp
@ -80,6 +91,17 @@ CMD \
useradd -M -g ${GID} -u ${UID} worker && \
chmod -R o-rwx ${WORKDIR_PATH} && \
# Create cache files and folders
if [ ! -e ${CACHE_PATH}/plugins/librelogin/lib ]; \
then mkdir -p ${CACHE_PATH}/plugins/librelogin/lib; \
fi && \
if [ ! -e ${CACHE_PATH}/plugins/luckperms/libs ]; \
then mkdir -p ${CACHE_PATH}/plugins/luckperms/libs; \
fi && \
if [ ! -e ${CACHE_PATH}/plugins/sonar/lib ]; \
then mkdir -p ${CACHE_PATH}/plugins/sonar/lib; \
fi && \
# Add proxy secret
sed -i "s/_PROXY_SECRET_/${PROXY_SECRET}/g" forwarding.secret && \