From dbc3be09f4634347a91eecc479e84933f370deca Mon Sep 17 00:00:00 2001 From: Newnius Date: Wed, 24 Apr 2019 09:57:37 +0800 Subject: [PATCH] update yao-portal --- yao-portal/dev/Dockerfile | 15 ++++++++ yao-portal/dev/bootstrap.sh | 23 ++++++++++++ yao-portal/dev/config/config.inc.php | 52 ++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 yao-portal/dev/Dockerfile create mode 100755 yao-portal/dev/bootstrap.sh create mode 100755 yao-portal/dev/config/config.inc.php diff --git a/yao-portal/dev/Dockerfile b/yao-portal/dev/Dockerfile new file mode 100644 index 0000000..9f43cd8 --- /dev/null +++ b/yao-portal/dev/Dockerfile @@ -0,0 +1,15 @@ +FROM newnius/php:7.3 + +MAINTAINER Newnius + +RUN apt update && \ + apt install -y git && \ + rm -rf /var/lib/apt/lists/* + +RUN git clone https://github.com/newnius/YAO-portal.git /var/www/html/ + +ADD config/config.inc.php /var/www/html/ + +ADD bootstrap.sh /etc/ + +CMD /etc/bootstrap.sh diff --git a/yao-portal/dev/bootstrap.sh b/yao-portal/dev/bootstrap.sh new file mode 100755 index 0000000..aae920a --- /dev/null +++ b/yao-portal/dev/bootstrap.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +if [[ -d /config/ ]]; then + if [[ ! -f /config/config.js ]]; then + cp /var/www/html/static/config.js /config/config.js + fi + + if [[ ! -f /config/config.inc.php ]]; then + cp /var/www/html/config.inc.php /config/config.inc.php + fi +fi + +if [[ -f /config/config.js ]]; then + rm /var/www/html/static/config.js + ln -s /config/config.js /var/www/html/static/config.js +fi + +if [[ -f /config/config.inc.php ]]; then + rm /var/www/html/config.inc.php + ln -s /config/config.inc.php /var/www/html/config.inc.php +fi + +apache2-foreground \ No newline at end of file diff --git a/yao-portal/dev/config/config.inc.php b/yao-portal/dev/config/config.inc.php new file mode 100755 index 0000000..a4c20f1 --- /dev/null +++ b/yao-portal/dev/config/config.inc.php @@ -0,0 +1,52 @@ +