From c19a54e63ab8f346fc53efcf376896370c3e1f1e Mon Sep 17 00:00:00 2001 From: Christoph Niehoff Date: Thu, 29 Apr 2021 11:50:48 +0200 Subject: [PATCH] adapt documentation due to docker-compose --- README.md | 13 +- docs/docker-setup.svg | 568 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 576 insertions(+), 5 deletions(-) create mode 100644 docs/docker-setup.svg diff --git a/README.md b/README.md index 948bd4d3..aebe9f57 100644 --- a/README.md +++ b/README.md @@ -33,14 +33,18 @@ npm run start The UI can also be built and served statically, keep in mind that the values of the port numbers will be hard coded in the generated files. ### Docker -The docker image uses `supervisord` to run both the UI and the server in the same container. The UI is built and served using `nginx`, it is also used to proxy requests from `/api` to the public API. +To start a dockerized version of the EoP game use -``` -docker build . -t eop:latest -docker run --rm -it -p 8080:80 eop:latest +```bash +docker-compose up --build ``` This would start EoP on port `8080` and would be accessible at `http://localhost:8080/`. +The docker-compose setup starts two container: + * `threats-client`: running `nginx` as a reverse proxy and serving the react application + * `threats-server`: running the `nodejs` backends: public API and game server + +![docker-compose setup](docs/docker-setup.svg) ## TODO * Spectator mode @@ -50,7 +54,6 @@ This would start EoP on port `8080` and would be accessible at `http://localhost * Improve test coverage, write tests for possible game states and moves * Refactor and have reusable components * Optimize component renders through `shouldComponentUpdate` -* Optimize docker image, currently using `ubuntu:latest` * Write contributing guide ## Credits diff --git a/docs/docker-setup.svg b/docs/docker-setup.svg new file mode 100644 index 00000000..e5ad4f81 --- /dev/null +++ b/docs/docker-setup.svg @@ -0,0 +1,568 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + docker: server + node + + public API + + game server + docker: client + + nginx + + docker-compose + + + Browser + + + + + + + + + static + react + app + + + + + :8001 + :8000 + :8002 + + + + + + + + + + db + @ + filesystem + + + + + + + + / + /api/ + /socket.io/ + :8080 + +