Skip to content
This repository was archived by the owner on Jul 16, 2020. It is now read-only.

Commit 006f72f

Browse files
committed
docker init
0 parents  commit 006f72f

File tree

162 files changed

+27905
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+27905
-0
lines changed

.dockerignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**/__pycache__
2+
**/.classpath
3+
**/.dockerignore
4+
**/.env
5+
**/.git
6+
**/.gitignore
7+
**/.project
8+
**/.settings
9+
**/.toolstarget
10+
**/.vs
11+
**/.vscode
12+
**/*.*proj.user
13+
**/*.dbmdl
14+
**/*.jfm
15+
**/azds.yaml
16+
**/bin
17+
**/charts
18+
**/docker-compose*
19+
**/Dockerfile*
20+
**/node_modules
21+
**/npm-debug.log
22+
**/obj
23+
**/secrets.dev.yaml
24+
**/values.dev.yaml
25+
README.md

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
venv/
2+
TiebaProject/__pycache__/*
3+
SignIn/__pycache__/
4+
db.sqlite3
5+
.github/
6+
*.pyc
7+
.vscode/

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# 贴吧云签到云回复Docker版
2+
3+
## 项目简介
4+
5+
独立开发的基于Django的贴吧云签到云回网站
6+
7+
作者维护的地址:http://sign.heeeepin.com/
8+
9+
## 安装
10+
11+
1. 安装docker
12+
13+
`curl -sSL https://get.docker.com | sh`
14+
15+
2. 安装docker-compose
16+
17+
`curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.5/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose`
18+
19+
3. 下载本项目并启动
20+
21+
``
22+
23+
## 讨论群
24+
25+
TG: https://t.me/tiebasign
26+
27+
qq群: 818794879
28+
29+
## LICENSE
30+
31+
[WTFPL – Do What the Fuck You Want to Public License](http://www.wtfpl.net/about/)

docker-compose.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
version: '3.4'
2+
3+
services:
4+
db:
5+
build:
6+
context: ./mysql
7+
dockerfile: Dockerfile
8+
volumes:
9+
- /home/tieba/mysql/data:/var/lib/mysql
10+
- /home/tieba/mysql/log:/var/log/mysql
11+
restart: always
12+
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --init-connect='SET NAMES utf8mb4;'
13+
expose:
14+
- "3306"
15+
environment:
16+
- MYSQL_DATABASE=tiebaproject
17+
- MYSQL_ROOT_PASSWORD=1BQnsRlwhOE5qfuY
18+
web:
19+
build:
20+
context: ./web
21+
dockerfile: Dockerfile
22+
volumes:
23+
- /home/tieba/django:/var/log/tieba
24+
command: bash start.sh
25+
ports:
26+
- "8000:8000"
27+
links:
28+
- db
29+
depends_on:
30+
- db
31+
restart: always
32+
nginx:
33+
build: ./nginx
34+
ports:
35+
- "80:80"
36+
volumes:
37+
- ./web/static:/usr/share/nginx/html/static
38+
- /home/tieba/nginx:/home/logs
39+
links:
40+
- web
41+
depends_on:
42+
- web
43+
restart: always
44+
45+

mysql/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# 使用docker仓库中的基础nginx镜像
2+
FROM mysql:5.6
3+
# 使用自定义的mysqld.cnf
4+
RUN rm /etc/mysql/mysql.conf.d/mysqld.cnf
5+
ADD mysqld.cnf /etc/mysql/mysql.conf.d/

mysql/mysqld.cnf

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
2+
#
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License, version 2.0,
5+
# as published by the Free Software Foundation.
6+
#
7+
# This program is also distributed with certain software (including
8+
# but not limited to OpenSSL) that is licensed under separate terms,
9+
# as designated in a particular file or component or in included license
10+
# documentation. The authors of MySQL hereby grant you an additional
11+
# permission to link the program and your derivative works with the
12+
# separately licensed software that they have included with MySQL.
13+
#
14+
# This program is distributed in the hope that it will be useful,
15+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
# GNU General Public License, version 2.0, for more details.
18+
#
19+
# You should have received a copy of the GNU General Public License
20+
# along with this program; if not, write to the Free Software
21+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22+
23+
#
24+
# The MySQL Server configuration file.
25+
#
26+
# For explanations see
27+
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
28+
29+
[mysqld]
30+
pid-file = /var/run/mysqld/mysqld.pid
31+
socket = /var/run/mysqld/mysqld.sock
32+
datadir = /var/lib/mysql
33+
log-error = /var/log/mysql/error.log
34+
# Disabling symbolic-links is recommended to prevent assorted security risks
35+
symbolic-links=0

nginx/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# 使用docker仓库中的基础nginx镜像
2+
FROM nginx
3+
# 开放端口
4+
EXPOSE 80 8000
5+
# 删除nginx原有配置文件
6+
RUN rm /etc/nginx/conf.d/default.conf
7+
# 将自己写的配置文件添加到容器
8+
ADD nginx.conf /etc/nginx/conf.d/
9+
# 创建web应用的静态文件存储
10+
RUN mkdir -p /usr/share/nginx/html/static
11+
# 创建存放日志的文件夹
12+
RUN mkdir -p /home/logs

nginx/nginx.conf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
server {
2+
listen 80;
3+
server_name localhost;
4+
charset utf-8;
5+
6+
error_log /home/logs/nginx_error.log;
7+
access_log /home/logs/nginx_access.log;
8+
9+
location /static {
10+
alias /usr/share/nginx/html/static;
11+
}
12+
13+
location / {
14+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
15+
proxy_set_header Host $http_host;
16+
proxy_redirect off;
17+
proxy_pass http://web:8000;
18+
}
19+
20+
}

web/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# For more information, please refer to https://aka.ms/vscode-docker-python
2+
FROM python:3.6
3+
4+
EXPOSE 8000
5+
6+
# Keeps Python from generating .pyc files in the container
7+
ENV PYTHONDONTWRITEBYTECODE 1
8+
9+
# Turns off buffering for easier container logging
10+
ENV PYTHONUNBUFFERED 1
11+
12+
# change the pip source
13+
ADD pip.conf /etc/pip.conf
14+
15+
# Install pip requirements
16+
ADD requirements.txt .
17+
RUN python -m pip install -r requirements.txt
18+
19+
RUN mkdir app
20+
WORKDIR /app
21+
ADD . /app
22+
23+

web/LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2+
Version 2, December 2004
3+
4+
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
5+
6+
Everyone is permitted to copy and distribute verbatim or modified
7+
copies of this license document, and changing it is allowed as long
8+
as the name is changed.
9+
10+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12+
13+
0. You just DO WHAT THE FUCK YOU WANT TO.

0 commit comments

Comments
 (0)