Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build automated with Compose #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM java:openjdk-7-jdk

RUN mkdir /compile

WORKDIR /compile

CMD [ "./compile.sh" ]
ADD compile.sh /compile/
ADD rsc/ /compile/rsc
ADD src/ /compile/src

RUN [ "./compile.sh"]
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3'

services:

graphwar:
image: graphwar
container_name: graphwar
build:
context: .
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
environment:
- DISPLAY=${DISPLAY}
command: java -jar graphwar.jar
23 changes: 0 additions & 23 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,6 @@ all:
rm -rf GlobalServer
rm -rf RoomServer

docker-graphwar:

## build graphwar inside of a container
docker run --rm \
-v ${PWD}:/compile \
graphwar/build

docker-image:

## build docker image
docker build -t graphwar/build .

run-client:

## run graphwar on a container
docker run --rm \
-v ${PWD}:/compile \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=${DISPLAY} \
--network host \
graphwar/build \
java -jar graphwar.jar

clean:

rm -r bin
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ Compile the game using the make command (or on your favorite IDE).

To run the game execute graphwar.jar.

Alternatively, you can try it with Docker Compose: `docker-compose up`

## Running Local Servers

To run a local server and connect to it you must pass the ip of the local server to graphwar
Expand Down