Running with Docker Compose
Starting game services locally
Obtain the source for the root project (gameontext/gameon)
git clone https://github.com/gameontext/gameon.git
git clone email@example.com:gameontext/gameon.git
Change to the gameon directory
Setup your environment (one time).
This will ensure that you have an env file suitable for use with
docker-composeand pulls the initial images required for running the system.
When using Vagrant, this step is done as part of provisioning the VM.
Create aliases to make it easier to manage core game services with
eval $(./docker/go-run.sh env)
Start the game!
Wait for the system warm up
or, to watch the logs stream by, try:
Carry on with building your room!
Files supporting Docker Compose
docker subdirectory of the root project
contains the files required to make game services go:
docker-compose.ymldeclares core game and required backing services
docker-compose.override.yml.examplecan be copied to
docker-compose.override.ymland modified to support overlays for local development
go-setup.shis a script to help configure your local environment to work with Docker Compose
go-run.shhelps with starting, stopping, and cleaning up Game ON core services.
docker-functionsis used by both
go-run.shto generate the keystore volume and generate environment-appropriate commands.
Additional notes when running with Docker Compose:
docker-composestill requires sudo on linux platforms, even though
The Vagrant VM allows all
sudooperations with no password.
Rebuilding Core Game services with Docker Compose
The following instructions assume you’ve cloned the root repository,
and are interested in editing the
map service as an example:
Change to the gameon directory
Obtain the source for the project that you want to change.
git submodule init map git submodule update map
Make your changes from within the child directory
cd map git checkout -b newbranch
Edit source or docker/image files using your favorite IDE.Tip
If you plan to edit projects with Eclipse, run
./bin/eclipse.shto generate eclipse project files.
Compile the source and rebuild docker image
To rebuild and restart the map service:
./docker/go-run.sh rebuild map
To rebuild the image without recreating the container:
./docker/go-run.sh rebuild_only map
If the service argument is left off, it will attempt to rebuild all of the core services (auth, map, mediator, player, room, webapp). If those submodules haven’t been checked out, there is no harm. The image from dockerhub will be used instead.NoteTop-down vs. incremental updates
If you want to try using incremental publish, where your changes are live inside the container without requiring the container to be stopped, started, rebuilt or otherwise messed with, you’ll need to create and/or add some lines to
./docker/docker-compose.override.ymlto create overlay volumes.
./docker/docker-compose.override.yml.exampleprovides examples of how to map expected github subrepository paths to volumes. Copy snippets from that file for the services you’re interested in into
./docker/go-run.shwill accommodate the creation of the
docker-compose.override.ymlfile, but you may need to run
eval $(./docker/go-run.sh env)to update your aliases.
Push your changes to a new branch. From the map directory:
git add -u git commit -sNote
Git commits must be signed
Once you make your commit, if you go back to the root directory, you will see a pending change for map. This indicates that the submodule is different than the version from the current branch of the root project. Do not check in this change. Sadly, these files can not be added to
Care must be taken to avoid staging these files if you otherwise end up making changes to files in the root project itself.