Allow to start the minecraft server from Docker (#5)
* feat(Docker): Dockerized minecraft application * Fixed typo & Improvements in README.md Co-authored-by: leomelki
This commit is contained in:
parent
8d75fb6020
commit
cc75c0746f
6 changed files with 82 additions and 4 deletions
0
.dockerignore
Normal file
0
.dockerignore
Normal file
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -20,3 +20,6 @@
|
|||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
# Minecraft data
|
||||
/minecraft_data
|
||||
|
|
35
README.md
35
README.md
|
@ -1,11 +1,14 @@
|
|||
|
||||
|
||||
|
||||
|
||||
## Table des matières
|
||||
|
||||
- [À propos](#à-propos)
|
||||
- [Installation](#installation)
|
||||
- [Dépendances requises](#dépendances-requises)
|
||||
- [Installation classique](#installation-classique)
|
||||
- [Installation avec docker (Alternative)](#installation-avec-docker-alternative)
|
||||
- [Commandes](#commandes)
|
||||
- [Crédits](#crédits)
|
||||
- [Aide](#aide)
|
||||
|
@ -25,6 +28,10 @@ Le mode Loup-Garou est un mode inspiré du jeu de société [Les Loups-Garous de
|
|||
|
||||
## Installation
|
||||
|
||||
### Dépendances requises
|
||||
- [ProtocolLib](https://www.spigotmc.org/resources/protocollib.1997/)
|
||||
|
||||
### Installation classique
|
||||
**Minecraft 1.15.1 est requis.**
|
||||
Pour installer le plug-in, merci de suivre les étapes suivantes:
|
||||
- Téléchargez Spigot 1.15.1 et lancez une fois le serveur
|
||||
|
@ -37,9 +44,33 @@ Pour installer le plug-in, merci de suivre les étapes suivantes:
|
|||
- ⚠️ N'oubliez pas de mettre votre pseudo. Exemple : `/lg start leomelki`
|
||||
|
||||
Lien des releases : [Cliquez ici](https://github.com/leomelki/LoupGarou/releases)
|
||||
### Dépendances requises
|
||||
|
||||
- [ProtocolLib](https://www.spigotmc.org/resources/protocollib.1997/)
|
||||
|
||||
### Installation avec docker (Alternative)
|
||||
|
||||
Vous devez avoir installé `docker` et `docker-compose` sur votre machine
|
||||
|
||||
#### Installation du serveur
|
||||
```sh
|
||||
docker-compose up -d --build
|
||||
```
|
||||
|
||||
#### Démarage du serveur
|
||||
|
||||
Vous devez exécuter la commande suivante à chaque redémarage de votre machine avant de pouvoir continuer
|
||||
|
||||
```sh
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
Ainsi, vous pouvez lancer le serveur en utilisant la commande suivante :
|
||||
|
||||
```sh
|
||||
docker-compose exec loup-garou java -jar spigot.jar
|
||||
```
|
||||
|
||||
Les fichiers relatifs à minecraft se situeront dans le dossier `minecraft_data`
|
||||
> **Tip :** Il faut accepter les conditions d'utilisations de Mojang en modifiant le fichier `minecraft_data/eula.txt`
|
||||
|
||||
## Commandes
|
||||
|
||||
|
|
13
docker-compose.yaml
Normal file
13
docker-compose.yaml
Normal file
|
@ -0,0 +1,13 @@
|
|||
version: "3.0"
|
||||
|
||||
services:
|
||||
loup-garou:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./docker/Dockerfile
|
||||
args:
|
||||
SPIGOT_VERSION: 1.15.1
|
||||
volumes:
|
||||
- ./minecraft_data:/minecraft
|
||||
ports:
|
||||
- 25565:25565
|
30
docker/Dockerfile
Normal file
30
docker/Dockerfile
Normal file
|
@ -0,0 +1,30 @@
|
|||
ARG SPIGOT_VERSION=1.15.1
|
||||
|
||||
# Build Loup-Garou project
|
||||
FROM maven:3.3-jdk-8 as LOUP_GAROU_BUILDER
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN mvn clean install
|
||||
RUN mvn package
|
||||
|
||||
# Build Spigot project
|
||||
FROM openjdk:8 AS SPIGOT_BUILDER
|
||||
ARG SPIGOT_VERSION
|
||||
WORKDIR /spigot
|
||||
RUN apt-get update
|
||||
ADD https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar buildtools.jar
|
||||
RUN git config --global --unset core.autocrlf || true
|
||||
RUN java -jar buildtools.jar --rev ${SPIGOT_VERSION}
|
||||
|
||||
# Final server image
|
||||
FROM openjdk:8
|
||||
ARG SPIGOT_VERSION
|
||||
WORKDIR /_minecraft
|
||||
COPY --from=LOUP_GAROU_BUILDER /app/target/LoupGarou.jar ./plugins/
|
||||
ADD https://github.com/dmulloy2/ProtocolLib/releases/download/4.5.0/ProtocolLib.jar ./plugins
|
||||
COPY --from=SPIGOT_BUILDER /spigot/spigot-${SPIGOT_VERSION}.jar ./spigot.jar
|
||||
|
||||
VOLUME /minecraft
|
||||
WORKDIR /minecraft
|
||||
EXPOSE 25565
|
||||
CMD cp -rn /_minecraft/* . && tail -f /dev/null
|
1
pom.xml
1
pom.xml
|
@ -8,6 +8,7 @@
|
|||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
<build>
|
||||
<finalName>LoupGarou</finalName>
|
||||
<sourceDirectory>src</sourceDirectory>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
|
Loading…
Reference in a new issue