Only adjust configs if none rolled in.

This commit is contained in:
Casey LP
2023-01-29 00:12:45 +00:00
committed by GitHub
parent 7c2848f29f
commit 59045d3ddf
5 changed files with 25 additions and 9 deletions
+8 -9
View File
@@ -5,17 +5,16 @@ LABEL org.opencontainers.image.authors="code@soupbowl.io"
LABEL org.opencontainers.image.source="https://github.com/soup-bowl/opensimulator-docker"
LABEL org.opencontainers.image.licenses="MIT"
RUN curl -o /bin/wait-for-it https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh \
&& chmod +x /bin/wait-for-it
RUN apt-get update && apt-get install -y screen
RUN mkdir /opt/opensim-tmp && curl http://opensimulator.org/dist/opensim-0.9.2.1.tar.gz | tar xzf - -C /opt/opensim-tmp
RUN mkdir /opt/opensim && mv /opt/opensim-tmp/opensim*/* /opt/opensim
RUN mkdir /opt/opensim-tmp \
&& curl http://opensimulator.org/dist/opensim-0.9.2.1.tar.gz | tar xzf - -C /opt/opensim-tmp \
&& rm /opt/opensim-tmp/opensim*/bin/OpenSim.ini \
&& rm /opt/opensim-tmp/opensim*/bin/config-include/StandaloneCommon.ini \
&& mkdir /opt/opensim \
&& mv /opt/opensim-tmp/opensim*/* /opt/opensim
COPY Regions.ini /opt/opensim/bin/Regions/Regions.ini
COPY OpenSim.ini /opt/opensim/bin/OpenSim.ini
COPY StandaloneCommon.ini /opt/opensim/bin/config-include/StandaloneCommon.ini
COPY defaults /opt/opensim/bin/defaults
EXPOSE 9000
@@ -24,4 +23,4 @@ WORKDIR /opt/opensim/bin
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
CMD [ "mono", "./OpenSim.exe" ]
CMD [ "mono", "./OpenSim.exe" ]
+17
View File
@@ -1,4 +1,21 @@
#!/usr/bin/env bash
set -Eeuo pipefail
chown -R $(id -u):$(id -g) defaults
if [ ! -e OpenSim.ini ]; then
echo >&2 "INFO: No OpenSim configuration found, pulling one together."
cp defaults/OpenSim.ini OpenSim.ini
fi
if [ ! -e config-include/StandaloneCommon.ini ]; then
echo >&2 "INFO: No Grid Common configuration found, pulling one together."
cp defaults/StandaloneCommon.ini config-include/StandaloneCommon.ini
fi
if [ `find Regions -maxdepth 1 -name '*.ini' | wc -l` -eq 0 ]; then
echo >&2 "INFO: No region details found, pulling one together."
cp defaults/Regions.ini Regions/Regions.ini
fi
exec "$@"