Merge pull request 'suggestion-74-cache-volume' (#47) from suggestion-74 into develop
All checks were successful
/ build-docker (push) Successful in 20m47s
All checks were successful
/ build-docker (push) Successful in 20m47s
Reviewed-on: #47 Reviewed-by: oznobys <oznobys@noreply.localhost>
This commit is contained in:
commit
f2bd3c74f9
39
Dockerfile
39
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}
|
||||
|
||||
|
||||
# Add symlinks to Minecraft Vanilla files
|
||||
@ -79,6 +81,20 @@ RUN mkdir -p ${DATA_PATH}/Chunky/tasks && \
|
||||
ln -sf ${DATA_PATH}/Chunky/tasks \
|
||||
${CONFIG_PATH}/plugins/Chunky/tasks
|
||||
|
||||
VOLUME ${DATA_PATH}
|
||||
|
||||
|
||||
# Add symlinks to cache files
|
||||
RUN ln -sf ${CACHE_PATH}/cache ${CONFIG_PATH}/cache && \
|
||||
ln -sf ${CACHE_PATH}/libraries ${CONFIG_PATH}/libraries && \
|
||||
ln -sf ${CACHE_PATH}/versions ${CONFIG_PATH}/versions && \
|
||||
ln -sf ${CACHE_PATH}/plugins/.paper-remapped ${CONFIG_PATH}/plugins/.paper-remapped && \
|
||||
ln -sf ${CACHE_PATH}/plugins/LuckPerms/libs ${CONFIG_PATH}/plugins/LuckPerms/libs && \
|
||||
ln -sf ${CACHE_PATH}/orebfuscator_cache ${CONFIG_PATH}/orebfuscator_cache
|
||||
|
||||
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 && \
|
||||
@ -87,9 +103,6 @@ RUN apt-get update -y && apt-get install -y locales && \
|
||||
ENV LANG en_US.UTF-8
|
||||
|
||||
|
||||
VOLUME ${DATA_PATH}
|
||||
|
||||
|
||||
# Minecraft
|
||||
EXPOSE 25565/tcp
|
||||
# BlueMap
|
||||
@ -167,6 +180,26 @@ CMD \
|
||||
useradd -M -g ${GID} -u ${UID} worker && \
|
||||
chmod -R o-rwx ${WORKDIR_PATH} && \
|
||||
|
||||
# Create cache files and folders
|
||||
if [ ! -e ${CACHE_PATH}/cache ]; \
|
||||
then mkdir -p ${CACHE_PATH}/cache; \
|
||||
fi && \
|
||||
if [ ! -e ${CACHE_PATH}/libraries ]; \
|
||||
then mkdir -p ${CACHE_PATH}/libraries; \
|
||||
fi && \
|
||||
if [ ! -e ${CACHE_PATH}/versions ]; \
|
||||
then mkdir -p ${CACHE_PATH}/versions; \
|
||||
fi && \
|
||||
if [ ! -e ${CACHE_PATH}/plugins/.paper-remapped ]; \
|
||||
then mkdir -p ${CACHE_PATH}/plugins/.paper-remapped; \
|
||||
fi && \
|
||||
if [ ! -e ${CACHE_PATH}/plugins/LuckPerms/libs ]; \
|
||||
then mkdir -p ${CACHE_PATH}/plugins/LuckPerms/libs; \
|
||||
fi && \
|
||||
if [ ! -e ${CACHE_PATH}/orebfuscator_cache ]; \
|
||||
then mkdir -p ${CACHE_PATH}/orebfuscator_cache; \
|
||||
fi && \
|
||||
|
||||
# Add proxy secret
|
||||
sed -i "s/_PROXY_SECRET_/${PROXY_SECRET}/g" config/paper-global.yml && \
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user