Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

安装报错解决手册 #22

Open
BigYoungs opened this issue Dec 30, 2021 · 1 comment
Open

安装报错解决手册 #22

BigYoungs opened this issue Dec 30, 2021 · 1 comment

Comments

@BigYoungs
Copy link

记录了一下自己安装时遇到的报错,记录文档:https://bigyoung.cn/posts/250/

还是得有一定的docker技术和python flask技术,能够自己排查报错,才能顺利安装。

@kblockd
Copy link

kblockd commented Oct 15, 2022

DockerFile

FROM alpine:latest

MAINTAINER sec@zto.cn

ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND noninteractive
ENV mongo_database acc
ENV mongo_host 127.0.0.1
ENV mongo_port 27017
# ENV mongo_user user
# ENV mongo_password 123456
ENV redis_host 127.0.0.1
ENV redis_port 6379
ENV redis_db 0
# ENV redis_password 123456

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories

RUN apk update && apk upgrade && apk add gcc g++ linux-headers python3 python3-dev py3-pip uwsgi-python3

RUN ln -s /usr/bin/python3 /usr/bin/python

COPY . /opt/authcheck

WORKDIR /opt/authcheck

RUN python3 -m pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

EXPOSE 8888

ENTRYPOINT ["uwsgi", "--ini", "uwsgi.ini"]

requirements.txt

Flask
requests
Flask-Cors
mongoengine
APScheduler
uWSGI
redis
tzlocal

uwsgi.ini

[uwsgi]
http-socket = 0.0.0.0:8888
chdir = /opt/authcheck
plugin = python3
wsgi-file = wsgi.py
callable = app
processes = 4
enable-threads = true
master = true
logto2 = /var/log/authcheck.log
pidfile = /var/run/uwsgi.pid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants