-
-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from LoRexxar/develop
update 2.3.0
- Loading branch information
Showing
28 changed files
with
569 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
FROM ubuntu:20.04 | ||
|
||
LABEL maintainer="LoRexxar <guoyinqi@xiaomi.com>" | ||
|
||
RUN sed -i "s/archive.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g" /etc/apt/sources.list && sed -i "s/archive.ubuntu.com/ubuntu/g" /etc/apt/sources.list | ||
|
||
# Set the locale | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US:en | ||
ENV LC_ALL en_US.UTF-8 | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y vim inetutils-ping curl ssh zip python3 python3-pip gunicorn | ||
|
||
# python换源 | ||
RUN mkdir /root/.pip | ||
RUN /bin/bash -c "echo -e '[global]\nindex-url = https://pypi.tuna.tsinghua.edu.cn/simple' > /root/.pip/pip.conf" | ||
RUN cat /root/.pip/pip.conf | ||
|
||
# mysql | ||
RUN apt-get install -y libmysqlclient-dev | ||
|
||
# nginx | ||
RUN apt-get install -y nginx | ||
|
||
# install | ||
COPY ./ /home/kunlun-m | ||
WORKDIR /home/kunlun-m | ||
|
||
RUN python3 -m pip install -r requirements.txt | ||
RUN cp Kunlun_M/settings.py.bak Kunlun_M/settings.py | ||
|
||
RUN python3 kunlun.py init | ||
|
||
# nginx config | ||
COPY /docker/nginx.conf /etc/nginx/ | ||
RUN mkdir /data && mkdir /data/log | ||
RUN /etc/init.d/nginx start | ||
|
||
RUN python3 -m pip install supervisor | ||
|
||
COPY /docker/supervisord.conf /etc/ | ||
RUN /usr/local/bin/supervisord && /usr/local/bin/supervisorctl start all | ||
|
||
ENTRYPOINT ["/usr/local/bin/supervisord", "-n", "&&", "/usr/local/bin/supervisorctl", "start", "all"] | ||
|
||
EXPOSE 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#user nobody; | ||
worker_processes 1; | ||
|
||
#error_log logs/error.log; | ||
#error_log logs/error.log notice; | ||
#error_log logs/error.log info; | ||
|
||
#pid logs/nginx.pid; | ||
|
||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
|
||
http { | ||
include mime.types; | ||
default_type application/octet-stream; | ||
|
||
#log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
# '$status $body_bytes_sent "$http_referer" ' | ||
# '"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
#access_log logs/access.log main; | ||
|
||
sendfile on; | ||
#tcp_nopush on; | ||
|
||
#keepalive_timeout 0; | ||
keepalive_timeout 65; | ||
|
||
#gzip on; | ||
|
||
server { | ||
listen 80; | ||
server_name localhost ; | ||
|
||
access_log /data/log/nginx-access.log; | ||
error_log /data/log/nginx-error.log; | ||
|
||
keepalive_timeout 3600; | ||
client_max_body_size 5120M; | ||
|
||
location /static/ { | ||
alias /home/kunlun-m/static; | ||
} | ||
|
||
location / { | ||
include uwsgi_params; | ||
add_header Access-Control-Allow-Origin *; | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-Forward-HOST $server_name; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_redirect off; | ||
proxy_connect_timeout 3800s; | ||
proxy_read_timeout 3600s; | ||
proxy_http_version 1.1; | ||
proxy_set_header Connection ""; | ||
proxy_pass http://127.0.0.1:8000; | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.