mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-18 02:06:43 +00:00
Merge pull request #75 from sgerrand/dockerize
Add a Docker image definition for the application and a Docker Compose configuration file
This commit is contained in:
commit
b2474494cc
7
Dockerfile
Normal file
7
Dockerfile
Normal file
@ -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"]
|
24
README.md
24
README.md
@ -4,10 +4,11 @@ In its current state, players can walk around the game universe and collect Biom
|
||||
|
||||

|
||||
|
||||
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)
|
||||
|
||||
# Deploying the server (Ubuntu or other Debian derivative)
|
||||
|
||||
# Deploying the server
|
||||
|
||||
Note: You can find the frontend [here](https://github.com/simon987/Much-Assembly-Required)
|
||||
|
||||
@ -31,3 +32,22 @@ java -jar server-1.2a.jar
|
||||
|
||||
## Windows
|
||||
Coming eventually...
|
||||
|
||||
## Docker
|
||||
### Requirements
|
||||
|
||||
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!
|
||||
|
21
docker-compose.yml
Normal file
21
docker-compose.yml
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user