!14 update dockerfile

Merge pull request !14 from jonnyan404/master
This commit is contained in:
州的先生 2021-03-01 20:09:48 +08:00 committed by Gitee
commit 87d918699f
2 changed files with 22 additions and 1 deletions

View File

@ -9,8 +9,10 @@ COPY . /app/MrDoc/
WORKDIR /app/MrDoc
RUN set -x \
&& apk add wqy-zenhei --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \
&& apk add --no-cache --virtual .build-deps build-base g++ gcc libxslt-dev python2-dev linux-headers \
&& apk add --no-cache pwgen git tzdata zlib-dev freetype-dev jpeg-dev mariadb-dev postgresql-dev \
&& python -m pip install --upgrade pip \
&& pip --no-cache-dir install -r requirements.txt \
&& pip --no-cache-dir install mysqlclient \
&& chmod +x docker_mrdoc.sh \

View File

@ -1,7 +1,26 @@
#!/bin/sh
python /app/MrDoc/manage.py makemigrations && python /app/MrDoc/manage.py migrate && echo y |python /app/MrDoc/manage.py rebuild_index
MM=`pwgen -1s`
CREATE_USER=1
CONFIG_FILE='/app/MrDoc/config/config.ini'
if [ ! -f $CONFIG_FILE ]; then
echo "#####Generating configuration file#####"
cat>"${CONFIG_FILE}"<<EOF
[site]
# True表示开启站点调试模式False表示关闭站点调试模式
debug = False
[database]
# engine指定数据库类型接受sqlite、mysql、oracle、postgresql
engine = sqlite
[selenium]
driver_path = /usr/lib/chromium/chromedriver
# 详细配置请查阅 https://www.mrdoc.fun/project-1/doc-190/
EOF
else
echo "#####Configuration file already exists#####"
fi
python /app/MrDoc/manage.py makemigrations && python /app/MrDoc/manage.py migrate && echo y |python /app/MrDoc/manage.py rebuild_index
if [ $CREATE_USER -eq 1 ]; then
if [ ! -e $CREATE_USER ]; then
touch $CREATE_USER