-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Dockerfile and docker-compose.yaml
- Loading branch information
Showing
8 changed files
with
88 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM ubuntu:18.04 | ||
|
||
ENV TZ "Asia/Shanghai" | ||
ENV LANG "C.UTF-8" | ||
|
||
RUN sed -i 's/archive.ubuntu.com/mirrors.163.com/g' /etc/apt/sources.list && \ | ||
sed -i 's/security.ubuntu.com/mirrors.163.com/g' /etc/apt/sources.list && \ | ||
echo $TZ > /etc/timezone && \ | ||
apt update && DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \ | ||
python3-pip python3-setuptools python3-wheel python3.6 tzdata && \ | ||
ln -s /usr/bin/python3.6 /usr/bin/python && ln -s /usr/bin/pip3 /usr/bin/pip | ||
|
||
RUN mkdir -p /web/logs | ||
WORKDIR /web | ||
|
||
ADD requirements.txt /web/requirements.txt | ||
RUN pip3 install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com | ||
|
||
ADD runserver.py /web/runserver.py | ||
ADD forums /web/forums | ||
ADD templates /web/templates | ||
ADD static /web/static | ||
ADD translations /web/translations | ||
|
||
CMD ["gunicorn","-b","0.0.0.0:8000","runserver:app"] |
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
# Author: jianglin | ||
# Email: [email protected] | ||
# Created: 2016-05-20 12:31:46 (CST) | ||
# Last Update: Wednesday 2019-05-08 16:28:02 (CST) | ||
# Last Update: Monday 2022-12-12 16:40:46 (CST) | ||
# By: jianglin | ||
# Description: | ||
# ************************************************************************** | ||
|
@@ -46,11 +46,18 @@ CACHE_REDIS_PASSWORD = 'your password' | |
CACHE_REDIS_DB = 2 | ||
|
||
# Redis setting | ||
REDIS = {'db': 1, 'password': 'your password', 'decode_responses': True} | ||
REDIS = { | ||
'host': 'redis', | ||
'db': 1, | ||
'password': 'your password', | ||
'decode_responses': True | ||
} | ||
|
||
# some middleware | ||
MIDDLEWARE = ['forums.common.middleware.GlobalMiddleware', | ||
'forums.common.middleware.OnlineMiddleware'] | ||
MIDDLEWARE = [ | ||
'forums.common.middleware.GlobalMiddleware', | ||
'forums.common.middleware.OnlineMiddleware' | ||
] | ||
|
||
# Mail such as qq | ||
MAIL_SERVER = 'smtp.qq.com' | ||
|
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,26 @@ | ||
version: "2.2" | ||
services: | ||
redis: | ||
image: redis:alpine | ||
ports: | ||
- 6379:6379 | ||
postgres: | ||
image: postgres:10 | ||
restart: always | ||
ports: | ||
- 5433:5432 | ||
environment: | ||
- POSTGRES_PASSWORD=test | ||
forums: | ||
build: | ||
context: . | ||
ports: | ||
- 8000:8000 | ||
links: | ||
- redis | ||
- postgres | ||
depends_on: | ||
- redis | ||
- postgres | ||
volumes: | ||
- ./config.py:/web/config.py |
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
# Author: jianglin | ||
# Email: [email protected] | ||
# Created: 2016-10-25 22:01:29 (CST) | ||
# Last Update: Monday 2019-05-06 23:36:53 (CST) | ||
# Last Update: Monday 2022-12-12 15:29:04 (CST) | ||
# By: | ||
# Description: | ||
# ************************************************************************** | ||
|