add WebUI in Dockerfile

This commit is contained in:
2023-01-07 14:43:43 +03:00
parent f60a37cd85
commit 108a6e67c2
4 changed files with 141 additions and 98 deletions

View File

@@ -14,14 +14,20 @@ SHELL ["/bin/bash", "-exo", "pipefail", "-c"]
LABEL name="BitDeals Module"
EXPOSE 4999 80
## Debian update; install dependencies for GPG
## Debian update; install dependencies
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y ; \
apt-get upgrade -y ; \
apt-get -y install --no-install-recommends locales ; \
apt-get -y install --no-install-recommends gpg gpg-agent ; \
apt-get -y install --no-install-recommends nginx ; \
apt-get clean ; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
## Generate UTF-8 locales
RUN sed -i '/\.UTF-8/s/^# //g' /etc/locale.gen; \
locale-gen
## Add the Module user
ARG UNAME
ARG UHOME
@@ -45,7 +51,7 @@ ARG UHOME
## Install OpenPGP
RUN su -l --shell /bin/bash $UNAME -c 'git clone https://github.com/calccrypto/OpenPGP ; \
mkdir OpenPGP/build ; cd OpenPGP/build ; \
sed -i "s/master/main/" ../contrib/cmake/GoogleTest.txt.in ; \
sed -i "s/master/v1.12.x/" ../contrib/cmake/GoogleTest.txt.in ; \
cmake -DUSE_OPENSSL=ON -DGPG_COMPATIBLE=ON .. ; \
make' ; \
cd $UHOME/OpenPGP/build/ ; \
@@ -64,12 +70,12 @@ RUN su -l --shell /bin/bash $UNAME -c 'wget https://raw.githubusercontent.com/li
chmod +x install.sh' ; \
cd $UHOME ; \
sed -i '/git clone / s/git.*$/while true; do & \&\& break; done/' install.sh ; \
sed -i '/wget / s/wget.*$/while true; do & \&\& break; done/' install.sh ; \
sed -i '/$WGET / s/$WGET.*$/while true; do & \&\& break; done/' install.sh ; \
./install.sh --build-boost --build-zmq --disable-shared
## Install BitDeals module (apostol-dm)
RUN su -l --shell /bin/bash $UNAME -c 'cd '$UHOME' ; \
git clone https://bitbucket.org/bitdeals/apostol-dm.git ; \
git clone https://git.bitdeals.org/private/apostol-dm.git ; \
cd apostol-dm ; \
./configure ; \
cd cmake-build-release ; \
@@ -77,27 +83,37 @@ RUN su -l --shell /bin/bash $UNAME -c 'cd '$UHOME' ; \
cd $UHOME/apostol-dm/cmake-build-release ;\
make install
## Download "build" directory from web-dm repository
RUN su -l --shell /bin/bash $UNAME -c 'cd '$UHOME' ; \
mkdir web-dm ;\
cd web-dm ;\
git init ;\
git remote add -f origin https://git.bitdeals.org/private/web-dm/ ;\
echo build >> .git/info/sparse-checkout ;\
git pull origin master'
FROM updated-debian
ARG UNAME
ARG UHOME
ENV UNAME=$UNAME
ENV LC_ALL=ru_RU.UTF-8
COPY --from=development /usr/local/ /usr/local/
COPY --from=development /etc/dm/ /etc/dm/
COPY --from=development /usr/sbin/dm /usr/sbin/dm
COPY --from=development /etc/init.d/dm /etc/init.d/dm
COPY --from=development --chown=www-data:www-data $UHOME/web-dm/build /var/www/web
COPY --from=development --chown=$UNAME:$UNAME $UHOME/apostol-dm/docker/bitdeals-test.asc /etc/dm/bitdeals-test.asc
#COPY --from=development --chown=$UNAME:$UNAME $UHOME/apostol-dm/docker/bitdeals.asc /etc/dm/bitdeals.asc
COPY --from=development $UHOME/apostol-dm/docker/entrypoint.sh /entrypoint.sh
COPY nginx.conf /etc/nginx/sites-enabled/default
#dm: error while loading shared libraries: libOpenPGP.so: cannot open shared object file: No such file or directory
RUN ldconfig
## Copy BitDeals PGP key
#ADD --chown=$UNAME:$UNAME https://www.example.com/bitdeals.asc /etc/dm/bitdeals.asc
COPY --chown=$UNAME:$UNAME ./bitdeals.asc /etc/dm/bitdeals.asc
COPY --chown=$UNAME:$UNAME ./bitdeals-test.asc /etc/dm/bitdeals-test.asc
RUN chmod 755 /entrypoint.sh
## Copy configuration helper script
#ADD https://bitbucket.org/bitdeals/apostol-dm/raw/master/docker/entrypoint.sh /entrypoint.sh
COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod 755 /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["/entrypoint.sh"]