forked from PaperMC/Velocity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed host forwarding and added docker CI/CD
- Loading branch information
Robbe Louwet
committed
Mar 16, 2024
1 parent
3a47ad2
commit d8ea389
Showing
4 changed files
with
47 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM --platform=linux/amd64 ubuntu:latest | ||
|
||
EXPOSE 25565/tcp | ||
EXPOSE 25565/udp | ||
|
||
WORKDIR / | ||
|
||
COPY ./entrypoint.sh /entrypoint.sh | ||
COPY ../proxy/build/libs/*-all.jar /velocity.jar | ||
|
||
COPY ./template-files/* / | ||
|
||
RUN apt-get update && apt-get install -y wget git openjdk-17-jre perl | ||
|
||
RUN wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 &&\ | ||
chmod a+x /usr/local/bin/yq | ||
|
||
# RUN wget -P / https://api.papermc.io/v2/projects/velocity/versions/3.2.0-SNAPSHOT/builds/294/downloads/velocity-3.2.0-SNAPSHOT-294.jar | ||
|
||
CMD [ "/bin/bash", "-c", "/entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
echo "JVM_ARGS: ${JVM_ARGS}" | ||
|
||
# Inject hostnames of backed server instances | ||
#perl -i -pe 's/(paper1\s*=\s*")[^"]*(")/\1$ENV{"PAPER1_HOST"}\2/' /data/velocity.toml | ||
#perl -i -pe 's/(paper2\s*=\s*")[^"]*(")/\1$ENV{"PAPER2_HOST"}\2/' /data/velocity.toml | ||
|
||
# Inject velocity secret | ||
echo "$VELOCITY_SECRET" > /forwarding.secret | ||
|
||
# Run the server | ||
java $JVM_ARGS -XX:+UseG1GC -XX:G1HeapRegionSize=4M -XX:+UnlockExperimentalVMOptions -XX:+ParallelRefProcEnabled -XX:+AlwaysPreTouch -XX:MaxInlineLevel=15 -jar /velocity*.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters