diff --git a/.dockerignore b/.dockerignore index 9cadf88..cebd599 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,6 @@ */logs +src/plugins/librelogin/lib src/librelogin.db src/plugins/luckperms/libs diff --git a/Dockerfile b/Dockerfile index d26eee4..79d7180 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 && \