-
Notifications
You must be signed in to change notification settings - Fork 172
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
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