This commit is contained in:
yangyu 2018-06-25 01:01:58 +08:00
parent 86253fede5
commit f2beacc199
2 changed files with 57 additions and 0 deletions

26
mindoc/0.10.1/Dockerfile Normal file
View File

@ -0,0 +1,26 @@
FROM centos:7
MAINTAINER Yang <yangyufans@qq.com>
RUN yum install -y wget unzip
RUN cd / && wget -O zoneinfo.zip https://github.com/lifei6671/mindoc/blob/master/lib/time/zoneinfo.zip?raw=true \
&& unzip zoneinfo.zip -d /zoneinfo \
&& rm -rf zoneinfo.zip
RUN echo "export ZONEINFO=/zoneinfo" >> /etc/profile && source /etc/profile
RUN cd / && wget https://github.com/lifei6671/mindoc/releases/download/v0.10.1/mindoc_linux_amd64.zip \
&& unzip mindoc_linux_amd64.zip -d /mindoc \
&& rm mindoc_linux_amd64.zip \
&& chmod +x /mindoc/mindoc_linux_amd64
EXPOSE 80
RUN cp /mindoc/conf/app.conf /mindoc
COPY start.sh /
RUN chmod 777 /start.sh
ENTRYPOINT ["/start.sh"]

31
mindoc/0.10.1/start.sh Normal file
View File

@ -0,0 +1,31 @@
#!/bin/bash
if [ ! -e /mindoc/conf/app.conf ]; then
cp /mindoc/app.conf /mindoc/conf
fi
if [ -n "$DB_HOST" ]; then
sed -i "s/db_host=127.0.0.1/db_host=$DB_HOST/" /mindoc/conf/app.conf
fi
if [ -n "$DB_PORT" ]; then
sed -i "s/db_port=3306/db_port=$DB_PORT/" /mindoc/conf/app.conf
fi
if [ -n "$DB_DATABASE" ]; then
sed -i "s/db_database=mindoc_db/db_database=$DB_DATABASE/" /mindoc/conf/app.conf
fi
if [ -n "$DB_USERNAME" ]; then
sed -i "s/db_username=root/db_username=$DB_USERNAME/" /mindoc/conf/app.conf
fi
if [ -n "$DB_PASSWORD" ]; then
sed -i "s/db_password=123456/db_password=$DB_PASSWORD/" /mindoc/conf/app.conf
fi
sed -i "s/httpport = 8181/httpport=80/" /mindoc/conf/app.conf
/mindoc/mindoc_linux_amd64 install
/mindoc/mindoc_linux_amd64