Mrdoc: 基于Python的在线文档系统

感谢jonnyan404 将mrdoc打包成docker镜像,这样下来非常便于安装。

但是对于修改后的mrdoc,就不能直接用pull docker的形式来安装。 昨天我就大胆地问了jonnyan404能否开源Dockerfile文件,他(她)毫不犹豫就给了。

下面是Dockerfile的生成代码,我还没有验证:

FROM python:3.7-alpine
LABEL maintainer="www.jonnyan404.top:8088"
ENV PYTHONUNBUFFERED=0 \
    TZ=Asia/Shanghai
COPY files/ /app
WORKDIR /app
RUN  set -x \
    && apk add --no-cache git tzdata zlib-dev freetype-dev jpeg-dev chromium mariadb-dev postgresql-dev \
    && apk add --no-cache --virtual .build-deps build-base g++ gcc libxslt-dev python2-dev linux-headers \
    && git clone https://github.com/zmister2016/MrDoc.git \
    && mv -f config.ini MrDoc/config/ \
    && mv -f editormd.css MrDoc/static/editor.md/css/ \
    && cd MrDoc \
    && pip install -r requirements.txt \
    && pip install mysqlclient \
    && python manage.py makemigrations \
    && python manage.py migrate \
    && echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('admin', '[email protected]', 'password')" | python manage.py shell \
    && apk del .build-deps \
    && rm -rf /var/cache/apk/*

WORKDIR /app/MrDoc
ENTRYPOINT ["python","-u","manage.py","runserver","--noreload"]
CMD ["0.0.0.0:10086"]

来源:Docker部署mrdoc by jonnyan404

阅读量: | 柯西君_BingWong | 2020-11-24