-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add dockerfile * add dockerfile * 归档内容 * 'Bump version: 0.1.8 → 1.0.1' * [archive] version: v1.0 -> v1.0.1 * 添加终版说明 * 添加终版说明 * Update README.md Co-authored-by: jianxin.lu <[email protected]>
- Loading branch information
Showing
11 changed files
with
89 additions
and
66 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# project | ||
.venv/ | ||
.git/ | ||
.idea/ | ||
.DS_Store | ||
*.lic | ||
logs/ | ||
|
||
|
||
# Python | ||
*.egg-info | ||
*.egg | ||
*.pyc | ||
.cache/ | ||
build/ | ||
dist/ | ||
|
||
# pytest | ||
.pytest_cache/ | ||
|
||
# files | ||
*.log |
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 |
---|---|---|
@@ -1,12 +1,22 @@ | ||
FROM python:3.8.12 AS runner | ||
FROM --platform=linux/amd64 python:3.8.12-slim AS runner | ||
MAINTAINER [email protected] | ||
WORKDIR /ishare | ||
ADD . . | ||
RUN pip install -r requirements.txt \ | ||
COPY . . | ||
RUN /usr/local/bin/python -m pip install --upgrade pip && \ | ||
pip install -r requirements.txt \ | ||
-i https://mirrors.aliyun.com/pypi/simple/ \ | ||
--trusted-host mirrors.aliyun.com \ | ||
--no-cache-dir && python manager.py collectstatic | ||
--no-cache-dir && \ | ||
python /ishare/manage.py collectstatic | ||
|
||
EXPOSE 7777:7777 | ||
CMD ["/usr/local/bin/uwsgi", "--ini", "/ishare/confs/uwsgi/uwsgi-docker.ini"] | ||
EXPOSE 7777 | ||
VOLUME /ishare/db.sqlite3 /ishare/media /ishare/STATIC | ||
CMD ["python3", \ | ||
"manage.py", \ | ||
"runserver", \ | ||
"--noreload", \ | ||
"--insecure", \ | ||
"--no-color", \ | ||
"0.0.0.0:7777" \ | ||
] | ||
|
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 |
---|---|---|
@@ -1 +1 @@ | ||
0.1.8 | ||
1.0.1 |
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 |
---|---|---|
|
@@ -27,16 +27,17 @@ | |
SECRET_KEY = '7=2y6u_5e=3mx0ut5hct!4t)g7gjy@7j_r$-(jv0&#n%v+@p=!' | ||
|
||
# SECURITY WARNING: don't run with debug turned on in production! | ||
DEBUG = True | ||
DEBUG = False | ||
|
||
# 维护期间阻止用户登录后台产生新的数据 | ||
UPGRADING = False | ||
UPGRADING = True | ||
|
||
pymysql.install_as_MySQLdb() | ||
|
||
ALLOWED_HOSTS = [ | ||
'www.lujianxin.com', | ||
'127.0.0.1', | ||
'blog.lujianxin.com', | ||
] | ||
|
||
SERVER = 'https://{}'.format(ALLOWED_HOSTS[0]) | ||
|
@@ -77,7 +78,7 @@ | |
'django.middleware.clickjacking.XFrameOptionsMiddleware', | ||
# 以下是自定义中间件 | ||
'blog.my_middlewares.AllMethodSupportMiddleware', | ||
'blog.my_middlewares.VisitCountMiddleware', | ||
# 'blog.my_middlewares.VisitCountMiddleware', | ||
# 以下是开启缓存中间件 | ||
# 'django.middleware.cache.CacheMiddleware', | ||
] | ||
|
@@ -213,14 +214,14 @@ | |
'team': 'lujianxin.com', | ||
'dns': ALLOWED_HOSTS[0], | ||
'host': 'https://{}'.format(ALLOWED_HOSTS[0]), | ||
'name': '陆鉴鑫的博客', | ||
'me': 'https://me.lujianxin.com', | ||
'author': "Jeeyshe", | ||
'name': '信息展示', | ||
'me': 'https://lujianxin.com', | ||
'author': "Jeyrce.Lu", | ||
'email': { | ||
'jubao': '[email protected]', | ||
'tougao': '[email protected]', | ||
'support': '[email protected]', | ||
'me': 'jeeyshe@gmail.com', | ||
'jubao': '[email protected]', | ||
'tougao': '[email protected]', | ||
'support': '[email protected]', | ||
'me': 'jeyrce@gmail.com', | ||
}, | ||
# 工信部备案号 | ||
'icp': { | ||
|
@@ -253,40 +254,26 @@ | |
CACHE_MIDDLEWARE_SECONDS = 180 | ||
CACHE_MIDDLEWARE_ALIAS = 'default' | ||
CACHES = { | ||
# 默认使用的库,session,csrf等存储 | ||
"default": { | ||
"BACKEND": "django_redis.cache.RedisCache", | ||
"LOCATION": "redis://127.0.0.1:6379/0", | ||
"OPTIONS": { | ||
"CLIENT_CLASS": "django_redis.client.DefaultClient", | ||
"CONNECTION_POOL_KWARGS": {"max_connections": 100}, | ||
"COMPRESSOR": "django_redis.compressors.zlib.ZlibCompressor", | ||
"PASSWORD": "lujianxin.com", | ||
} | ||
'default': { | ||
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', | ||
'LOCATION': 'unique-snowflake', | ||
}, | ||
'one': { | ||
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', | ||
'LOCATION': 'unique-snowflake', | ||
}, | ||
# 重置密码token | ||
"one": { | ||
"BACKEND": "django_redis.cache.RedisCache", | ||
"LOCATION": "redis://127.0.0.1:6379/1", | ||
"OPTIONS": { | ||
"CLIENT_CLASS": "django_redis.client.DefaultClient", | ||
"CONNECTION_POOL_KWARGS": {"max_connections": 100}, | ||
"COMPRESSOR": "django_redis.compressors.zlib.ZlibCompressor", | ||
"PASSWORD": "lujianxin.com", | ||
} | ||
'two': { | ||
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', | ||
'LOCATION': 'unique-snowflake', | ||
}, | ||
# 2号3号库用作celery的任务队列 | ||
|
||
# 专做本站访问次数记录 | ||
"four": { | ||
"BACKEND": "django_redis.cache.RedisCache", | ||
"LOCATION": "redis://127.0.0.1:6379/4", | ||
"OPTIONS": { | ||
"CLIENT_CLASS": "django_redis.client.DefaultClient", | ||
"CONNECTION_POOL_KWARGS": {"max_connections": 10}, | ||
"PASSWORD": "lujianxin.com", | ||
} | ||
'three': { | ||
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', | ||
'LOCATION': 'unique-snowflake', | ||
}, | ||
'four': { | ||
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', | ||
'LOCATION': 'unique-snowflake', | ||
} | ||
} | ||
|
||
############ | ||
|
@@ -298,7 +285,7 @@ | |
# Cookie name. This can be whatever you want. | ||
SESSION_COOKIE_NAME = 'sessionid' | ||
# Age of cookie, in seconds (default: 2 weeks). | ||
SESSION_COOKIE_AGE = 60 * 60 * 24 * 7 * 2 | ||
SESSION_COOKIE_AGE = 60 * 60 | ||
# The path of the session cookie. | ||
SESSION_COOKIE_PATH = '/' | ||
SESSION_EXPIRE_AT_BROWSER_CLOSE = not DEBUG | ||
|
@@ -321,24 +308,24 @@ | |
} | ||
|
||
# ----------本站系统所用email配置---------- | ||
SERVER_EMAIL = '[email protected]' | ||
SERVER_EMAIL = '[email protected]' | ||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' | ||
EMAIL_HOST = 'smtp.exmail.qq.com' | ||
EMAIL_PORT = 465 | ||
|
||
EMAIL_USE_LOCALTIME = False | ||
|
||
# Optional SMTP authentication information for EMAIL_HOST. | ||
EMAIL_HOST_USER = '[email protected]' | ||
EMAIL_HOST_USER = '[email protected]' | ||
EMAIL_HOST_PASSWORD = 'lujianxin.com' | ||
EMAIL_USE_TLS = False | ||
EMAIL_USE_SSL = True | ||
EMAIL_SSL_CERTFILE = None | ||
EMAIL_SSL_KEYFILE = None | ||
EMAIL_TIMEOUT = None | ||
|
||
DEFAULT_FROM_EMAIL = '[email protected]' | ||
EMAIL_SUBJECT_PREFIX = '[陆鉴鑫的博客]' | ||
DEFAULT_FROM_EMAIL = '[email protected]' | ||
EMAIL_SUBJECT_PREFIX = '[信息展示]' | ||
|
||
LIST_INFO = { | ||
'page_size': 30, | ||
|
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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