diff --git a/README.md b/README.md index e83a3b4..a04f0f4 100644 --- a/README.md +++ b/README.md @@ -36,14 +36,14 @@ Spug是一款使用Python+Flask+Vue+Element组件开发的开源运维管理系 ### 快速启动 ---------------------------- ``` -$ docker pull hub.qbangmang.com/spug +$ docker pull reg.qiniu.com/openspug/spug $ docker run -d -p 80:80 hub.qbangmang.com/spug $ 访问:http://主机ip $ 默认账号密码:admin/spug # 可选参数: -$ docker run -d -e REGISTRY_SERVER="hub.qbangmang.com" -p 80:80 hub.qbangmang.com/spug +$ docker run -d -e REGISTRY_SERVER="hub.qbangmang.com" -p 80:80 reg.qiniu.com/openspug/spug $ -e MYSQL_HOST = "192.168.1.10" // 指定数据库地址 -e MYSQL_DATABASE="spug" // 指定数据库名称, diff --git a/docs/Dockerfile/Dockerfile b/docs/Dockerfile/Dockerfile index 75744bb..b96a099 100644 --- a/docs/Dockerfile/Dockerfile +++ b/docs/Dockerfile/Dockerfile @@ -1,12 +1,15 @@ FROM python:3.6-alpine +ENV VERSION=1.0.5 -RUN echo -e "http://mirrors.aliyun.com/alpine/v3.9/main\nhttp://mirrors.aliyun.com/alpine/v3.9/community" > /etc/apk/repositories -RUN apk update && apk add --no-cache nginx mariadb nodejs-npm git +RUN echo -e "http://mirrors.aliyun.com/alpine/v3.10/main\nhttp://mirrors.aliyun.com/alpine/v3.10/community" > /etc/apk/repositories +RUN apk update && apk add --no-cache nginx mariadb nodejs-npm git RUN apk add --no-cache --virtual .build-deps openssl-dev gcc musl-dev python3-dev libffi-dev openssl-dev make -RUN git clone https://github.com/openspug/spug.git --depth=1 /spug && cd /spug && git pull +RUN echo $VERSION && git clone https://github.com/openspug/spug.git --depth=1 /spug && cd /spug && git pull + RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ && pip install --upgrade pip && pip install --no-cache-dir -r /spug/spug_api/requirements.txt \ && pip install --no-cache-dir gunicorn \ && apk del .build-deps + RUN cd /spug/spug_web/ && npm i && npm run build \ && mv /spug/spug_web/dist /var/www/ @@ -14,4 +17,4 @@ ADD default.conf /etc/nginx/conf.d/default.conf ADD entrypoint.sh /entrypoint.sh ADD scripts /scripts -ENTRYPOINT ["sh", "/entrypoint.sh"] +ENTRYPOINT ["sh", "/entrypoint.sh"] \ No newline at end of file diff --git a/docs/Dockerfile/pip.conf b/docs/Dockerfile/pip.conf new file mode 100644 index 0000000..04a5698 --- /dev/null +++ b/docs/Dockerfile/pip.conf @@ -0,0 +1,5 @@ +[global] +index-url = https://mirrors.aliyun.com/pypi/simple/ + +[install] +trusted-host=mirrors.aliyun.com diff --git a/docs/Dockerfile/scripts/init_config.sh b/docs/Dockerfile/scripts/init_config.sh index bb2f647..f2d87fb 100644 --- a/docs/Dockerfile/scripts/init_config.sh +++ b/docs/Dockerfile/scripts/init_config.sh @@ -11,7 +11,9 @@ DOCKER_URL = 'unix:///var/run/docker.sock' SQLALCHEMY_ECHO = False EOF -echo "SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://${MYSQL_USER:-spuguser}:${MYSQL_PASSWORD:-spugpwd}@${MYSQL_HOST:-localhost}:${MYSQL_PORT:-3306}/${MYSQL_DATABASE:-spug}?unix_socket=/run/mysqld/mysqld.sock'" >> /spug/spug_api/config.py +# echo "SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://${MYSQL_USER:-spuguser}:${MYSQL_PASSWORD:-spugpwd}@${MYSQL_HOST:-localhost}:${MYSQL_PORT:-3306}/${MYSQL_DATABASE:-spug}?unix_socket=/run/mysqld/mysqld.sock'" >> /spug/spug_api/config.py + +echo "SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://${MYSQL_USER:-spuguser}:${MYSQL_PASSWORD:-spugpwd}@${MYSQL_HOST:-localhost}:${MYSQL_PORT:-3306}/${MYSQL_DATABASE:-spug}'" >> /spug/spug_api/config.py echo "DOCKER_REGISTRY_SERVER = '${REGISTRY_SERVER:-hub.qbangmang.com}'" >> /spug/spug_api/config.py echo "DOCKER_REGISTRY_AUTH = {'username': '${REGISTRY_USER}', 'password': '${REGISTRY_PASSWORD}'}" >> /spug/spug_api/config.py