forked from camelop/doudizhu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce7f7e3
commit a52bcb8
Showing
96 changed files
with
677 additions
and
368 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,15 @@ | ||
FROM python:3.7.2-alpine | ||
|
||
ENV PYTHONUNBUFFERED 1 | ||
|
||
COPY ../.../requirements.txt requirements.txt | ||
COPY ../../doudizhu /app | ||
|
||
RUN apk add --no-cache --update gcc musl-dev openssl-dev libffi-dev libjpeg-turbo-dev | ||
RUN pip install -r requirements.txt -i https://pypi.douban.com/simple | ||
|
||
ENTRYPOINT ["entrypoint.sh"] | ||
|
||
WORKDIR /app | ||
EXPOSE 8080 | ||
CMD ["python3", "app.py"] |
File renamed without changes.
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,2 @@ | ||
FROM nginx:latest | ||
ADD nginx.conf /etc/nginx/conf.d/doudizhu |
Empty file.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
version: "3" | ||
|
||
services: | ||
nginx: | ||
build: ./compose/nginx | ||
|
||
doudizhu: | ||
image: mailyc/doudizhu:latest | ||
build: ./compose/app/ | ||
command: python3 app.py --host=172.20.0.1 | ||
networks: | ||
- default | ||
ports: | ||
- "8080:8080" | ||
volumes: | ||
- /var/log:/var/log | ||
- ./doudizhu:/app | ||
restart: always | ||
|
||
networks: | ||
default: | ||
driver: bridge | ||
|
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,5 @@ | ||
import os | ||
import sys | ||
|
||
|
||
sys.path.insert(0, os.path.join(os.path.dirname(__file__))) |
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,52 @@ | ||
import logging.config | ||
from concurrent.futures import ThreadPoolExecutor | ||
|
||
import tornado.web | ||
import tornado.websocket | ||
from tornado.ioloop import IOLoop | ||
from tornado.options import options | ||
|
||
from apps.urls import url_patterns | ||
from contrib.db import AsyncConnection | ||
from settings import settings | ||
|
||
logging.config.dictConfig(settings.LOGGING) | ||
|
||
# APPLICATION = { | ||
# 'login_url': '/', | ||
# 'xheaders': True, | ||
# } | ||
|
||
|
||
class Application(tornado.web.Application): | ||
settings = { | ||
'debug': settings.DEBUG, | ||
'gzip': getattr(settings, 'GZIP', False), | ||
'cookie_secret': settings.SECRET_KEY, | ||
'xsrf_cookies': getattr(settings, 'XSRF_COOKIES', True), | ||
'autoescape': "xhtml_escape", | ||
'template_path': settings.TEMPLATE_ROOT, | ||
'static_path': settings.STATIC_ROOT, | ||
'static_url_prefix': settings.STATIC_URL, | ||
} | ||
|
||
def __init__(self): | ||
super().__init__(url_patterns, **self.settings) | ||
self.db = AsyncConnection(**settings.DATABASE) | ||
self.executor = ThreadPoolExecutor() | ||
|
||
|
||
def make_app(port): | ||
app = Application() | ||
app.listen(port) | ||
return app | ||
|
||
|
||
def main(): | ||
make_app(settings.PORT) | ||
logging.info(f'server on http://127.0.0.1:{settings.PORT}') | ||
IOLoop.current().start() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
Empty file.
Empty file.
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 @@ | ||
|
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
File renamed without changes.
File renamed without changes.
Oops, something went wrong.