From 7821d428e226e584402df5ef707e71bf6e3ceb35 Mon Sep 17 00:00:00 2001 From: Sasha Gerrand Date: Sun, 31 Dec 2017 08:34:17 +0000 Subject: [PATCH 1/4] :whale: Add Dockerfile --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..42abd15 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:3.7 +RUN apk add --no-cache maven openjdk8 +COPY /. /app/ +WORKDIR /app +RUN mvn package \ + && cp Server/src/main/resources/config.properties /app/ +CMD ["java", "-jar", "/app/target/server-1.2a.jar"] From 99cefba24517c7c1911702fed2cb025e124d71d4 Mon Sep 17 00:00:00 2001 From: Sasha Gerrand Date: Sun, 31 Dec 2017 08:35:02 +0000 Subject: [PATCH 2/4] :fork_and_knife: Orchestrate server and dependencies using containers --- docker-compose.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..08fb8c2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +version: "2.1" +services: + server: + build: + context: . + command: sh -c "sed -i -e 's#localhost#db#' config.properties && /usr/bin/java -jar /app/target/server-1.2a.jar" + depends_on: + db: + condition: service_healthy + ports: + - "8887:8887" + db: + image: mysql + healthcheck: + test: ["CMD", "mysqladmin" ,"ping", "-umar", "-pmar"] + environment: + MYSQL_DATABASE: mar + MYSQL_PASSWORD: mar + MYSQL_RANDOM_ROOT_PASSWORD: "yes" + MYSQL_ROOT_PASSWORD: something-secret + MYSQL_USER: mar From 37e40d03294a78ea8d506a3f8b66e28919e4f3c6 Mon Sep 17 00:00:00 2001 From: Sasha Gerrand Date: Sun, 31 Dec 2017 08:37:31 +0000 Subject: [PATCH 3/4] :scissors: Remove extraneous whitespace --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 125a461..01fea7a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ In its current state, players can walk around the game universe and collect Biom ![screenshot from 2017-11-12 13-01-43](https://user-images.githubusercontent.com/7120851/32701793-e5d07e98-c7a9-11e7-9931-f8db7b287994.png) -Wiki: [GitHub](https://github.com/simon987/Much-Assembly-Required/wiki) +Wiki: [GitHub](https://github.com/simon987/Much-Assembly-Required/wiki) Chat: [Slack](https://join.slack.com/t/muchassemblyrequired/shared_invite/enQtMjY3Mjc1OTUwNjEwLTkyOTIwOTA5OGY4MDVlMGI4NzM5YzlhMWJiMGY1OWE2NjUxODQ1NWQ1YTcxMTA1NGZkYzNjYzMyM2E1ODdmNzg) From 4a6ee4cce6154b05f9bde771723b9bb6d64b5eec Mon Sep 17 00:00:00 2001 From: Sasha Gerrand Date: Sun, 31 Dec 2017 08:45:11 +0000 Subject: [PATCH 4/4] :open_book: Add installation and running documentation --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 01fea7a..eb6ca0c 100644 --- a/README.md +++ b/README.md @@ -7,5 +7,20 @@ In its current state, players can walk around the game universe and collect Biom Wiki: [GitHub](https://github.com/simon987/Much-Assembly-Required/wiki) Chat: [Slack](https://join.slack.com/t/muchassemblyrequired/shared_invite/enQtMjY3Mjc1OTUwNjEwLTkyOTIwOTA5OGY4MDVlMGI4NzM5YzlhMWJiMGY1OWE2NjUxODQ1NWQ1YTcxMTA1NGZkYzNjYzMyM2E1ODdmNzg) +## Requirements -_Building instructions coming soon_ +1. [Docker Compose](https://docs.docker.com/compose/install/#install-compose) (and dependencies) + +## Installation + +Once Docker and Docker Compose are installed, you can build and start +this application by running the following command inside this +application's directory: + + docker-compose up + +This will start MySQL and then build and run this application. It will +be available via http://localhost. + +Note that there is currently no frontend web application serving the +WebSocket feed served by the `Server` application!