Add autostart for joinmarket image

This commit is contained in:
nicolas.dorier 2021-10-20 11:36:44 +09:00
parent a34a4de0fe
commit 4df8202cbd
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE
5 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,6 @@
# Remove comments in from of the service you want to automatically restart
# when the container restart.
# ob-watcher
# yg-privacyenhanced
# yield-generator-basic

View File

@ -13,6 +13,23 @@ if ! [ -f "$CONFIG" ]; then
cp "$DEFAULT_CONFIG" "$CONFIG"
fi
if ! [ -f "$AUTO_START" ]; then
cp "$DEFAULT_AUTO_START" "$AUTO_START"
fi
# auto start services
while read p; do
[[ "$p" == "" ]] && continue
[[ "$p" == "#"* ]] && continue
echo "Auto start: $p"
file_path="/etc/supervisor/conf.d/$p.conf"
if [ -f "$file_path" ]; then
sed -i 's/autostart=false/autostart=true/g' $file_path
else
echo "$file_path not found"
fi
done <$AUTO_START
# For every env variable JM_FOO=BAR, replace the default configuration value of 'foo' by 'bar'
while IFS='=' read -r -d '' n v; do
n="${n,,}" # lowercase

View File

@ -15,6 +15,8 @@ RUN ./install.sh --disable-secp-check --without-qt
ENV DATADIR /root/.joinmarket
ENV CONFIG ${DATADIR}/joinmarket.cfg
ENV DEFAULT_CONFIG /root/default.cfg
ENV DEFAULT_AUTO_START /root/autostart
ENV AUTO_START ${DATADIR}/autostart
ENV ENV_FILE "${DATADIR}/.env"
RUN . jmvenv/bin/activate && cd /src/scripts && \
pip install matplotlib && \
@ -23,6 +25,7 @@ RUN . jmvenv/bin/activate && cd /src/scripts && \
WORKDIR /src/scripts
COPY docker-entrypoint.sh .
COPY *.sh ./
COPY autostart /root/
COPY supervisor-conf/*.conf /etc/supervisor/conf.d/
ENV PATH /src/scripts:$PATH
EXPOSE 62601 8080

View File

@ -29,6 +29,8 @@ RUN ./install.sh --disable-secp-check --without-qt
ENV DATADIR /root/.joinmarket
ENV CONFIG ${DATADIR}/joinmarket.cfg
ENV DEFAULT_CONFIG /root/default.cfg
ENV DEFAULT_AUTO_START /root/autostart
ENV AUTO_START ${DATADIR}/autostart
ENV ENV_FILE "${DATADIR}/.env"
RUN . jmvenv/bin/activate && cd /src/scripts && \
(python wallet-tool.py generate || true) \
@ -36,6 +38,7 @@ RUN . jmvenv/bin/activate && cd /src/scripts && \
WORKDIR /src/scripts
COPY docker-entrypoint.sh .
COPY *.sh ./
COPY autostart /root/
COPY supervisor-conf/*.conf /etc/supervisor/conf.d/
ENV PATH /src/scripts:$PATH
EXPOSE 62601 8080

View File

@ -20,6 +20,8 @@ ENV DATADIR /root/.joinmarket
ENV CONFIG ${DATADIR}/joinmarket.cfg
ENV DEFAULT_CONFIG /root/default.cfg
ENV ENV_FILE "${DATADIR}/.env"
ENV DEFAULT_AUTO_START /root/autostart
ENV AUTO_START ${DATADIR}/autostart
RUN . jmvenv/bin/activate && cd /src/scripts && \
pip install matplotlib && \
(python wallet-tool.py generate || true) \
@ -27,6 +29,7 @@ RUN . jmvenv/bin/activate && cd /src/scripts && \
WORKDIR /src/scripts
COPY docker-entrypoint.sh .
COPY *.sh ./
COPY autostart /root/
COPY supervisor-conf/*.conf /etc/supervisor/conf.d/
ENV PATH /src/scripts:$PATH
EXPOSE 62601 8080