mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-21 00:59:22 +00:00
Update README + run Docker
This commit is contained in:
parent
0d3d219315
commit
40b3ca9d9f
3 changed files with 10 additions and 16 deletions
3
Dockerfile
vendored
3
Dockerfile
vendored
|
|
@ -10,6 +10,7 @@ COPY . /cloud-game/
|
|||
WORKDIR /cloud-game
|
||||
|
||||
# Install server dependencies
|
||||
RUN go install ./cmd
|
||||
RUN go install ./cmd/overlord
|
||||
RUN go install ./cmd/overworker
|
||||
|
||||
EXPOSE 8000
|
||||
|
|
|
|||
19
Makefile
vendored
19
Makefile
vendored
|
|
@ -77,19 +77,12 @@ dev.run: dev.build-local
|
|||
|
||||
|
||||
|
||||
#dev.run: dev.build
|
||||
# # Run coordinator first
|
||||
# ./build/klog -overlordhost overlord &
|
||||
# # Wait till overlord finish initialized
|
||||
# # Run a worker connecting to overload
|
||||
# ./build/klog -overlordhost ws://localhost:8000/wso
|
||||
|
||||
#dev.run.docker:
|
||||
# docker build . -t cloud-game-local
|
||||
# docker stop cloud-game-local
|
||||
# docker rm cloud-game-local
|
||||
# # Overlord and worker should be run separately. Local is for demo purpose
|
||||
# docker run --privileged -v $PWD/games:/cloud-game/games -d --name cloud-game-local -p 8000:8000 -p 9000:9000 cloud-game-local bash -c "cmd -overlordhost ws://localhost:8000/wso & cmd -overlordhost overlord"
|
||||
dev.run-docker:
|
||||
docker build . -t cloud-game-local
|
||||
docker stop cloud-game-local
|
||||
docker rm cloud-game-local
|
||||
# Overlord and worker should be run separately.
|
||||
docker run --privileged -v $PWD/games:/cloud-game/games -d --name cloud-game-local -p 8000:8000 -p 9000:9000 cloud-game-local bash -c "overlord --v=5 & overworker --overlordhost ws://localhost:8000/wso"
|
||||
|
||||
#build:
|
||||
# go build -o build/cloudretro ./cmd
|
||||
|
|
|
|||
4
README.md
vendored
4
README.md
vendored
|
|
@ -27,7 +27,7 @@ Screenshot | Screenshot
|
|||
|
||||
## Run on local by Docker
|
||||
|
||||
You try running the server yourself by running `make run-docker`. It will spawn a docker environment and you can access the service on `localhost:8000`.
|
||||
You try running the server yourself by running `make dev.run-docker`. It will spawn a docker environment and you can access the service on `localhost:8000`.
|
||||
|
||||
## Development environment
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ brew install libvpx pkg-config opus opusfile
|
|||
|
||||
Because coordinator and workers needs to run simulateneously. Workers connects to coordinator.
|
||||
1. Script
|
||||
* `make run`
|
||||
* `make dev.run`
|
||||
* The scripts spawns 2 processes one in background and one in foreground
|
||||
2. Manual
|
||||
* Need to run coordinator and worker separately in two session
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue