changed path of the data store from /app/data to /data

pull/2/head
Sameer Naik 2014-06-29 12:18:05 +05:30
parent 35fe73d978
commit 907938b1f6
2 changed files with 15 additions and 15 deletions

View File

@ -15,5 +15,5 @@ RUN chmod 755 /init
EXPOSE 53/udp
EXPOSE 10000
VOLUME ["/app/data"]
VOLUME ["/data"]
CMD ["/init"]

28
init
View File

@ -6,35 +6,35 @@ ROOT_PASSWORD=$(pwgen -c -n -1 12)
echo "root:$ROOT_PASSWORD" | chpasswd
echo User: root Password: $ROOT_PASSWORD
chmod 775 /app/data
chmod 775 /data
# create directory for bind config
mkdir -p /app/data/bind
chown -R root:bind /app/data/bind
mkdir -p /data/bind
chown -R root:bind /data/bind
# populate default bind configuration if it does not exist
if [ ! -d /app/data/bind/etc ]; then
mv /etc/bind /app/data/bind/etc
if [ ! -d /data/bind/etc ]; then
mv /etc/bind /data/bind/etc
fi
rm -rf /etc/bind
ln -sf /app/data/bind/etc /etc/bind
ln -sf /data/bind/etc /etc/bind
if [ ! -d /app/data/bind/lib ]; then
mkdir -p /app/data/bind/lib
chown root:bind /app/data/bind/lib
if [ ! -d /data/bind/lib ]; then
mkdir -p /data/bind/lib
chown root:bind /data/bind/lib
fi
rm -rf /var/lib/bind
ln -sf /app/data/bind/lib /var/lib/bind
ln -sf /data/bind/lib /var/lib/bind
# create directory for webmin
mkdir -p /app/data/webmin
mkdir -p /data/webmin
# populate the default webmin configuration if it does not exist
if [ ! -d /app/data/webmin/etc ]; then
mv /etc/webmin /app/data/webmin/etc
if [ ! -d /data/webmin/etc ]; then
mv /etc/webmin /data/webmin/etc
fi
rm -rf /etc/webmin
ln -sf /app/data/webmin/etc /etc/webmin
ln -sf /data/webmin/etc /etc/webmin
/etc/init.d/webmin start