diff --git a/Dockerfile b/Dockerfile index c383575..03bd04a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ FROM python:3.11-alpine COPY glebby-server /glebby-server WORKDIR /glebby-server RUN pip install -r requirements.txt -RUN pip install gunicorn -COPY --from=frontend /glebby-client/static /glebby-server/static +RUN pip install hypercorn +COPY --from=frontend /glebby-client/static /glebby-server/glebby/static -CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--threads", "100", "glebby:app"] +CMD ["hypercorn", "--bind", "0.0.0.0:5000", "glebby:app"] diff --git a/TODO.md b/TODO.md index e6ebab5..dda7839 100644 --- a/TODO.md +++ b/TODO.md @@ -1,5 +1,6 @@ - [ ] composition api -- [ ] quart +- [x] quart + - [x] fix dockerfile - [ ] lobby - [ ] actual game logic - [ ] websocket url config diff --git a/glebby-server/glebby/__init__.py b/glebby-server/glebby/__init__.py index da6c5a4..86ebcfd 100644 --- a/glebby-server/glebby/__init__.py +++ b/glebby-server/glebby/__init__.py @@ -12,6 +12,10 @@ async def send_outgoing(queue): data = await queue.get() await websocket.send(data) +@app.route('/') +async def root(): + return await app.send_static_file('index.html') + @app.websocket('/glebby') async def ws(): global model