-
-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathDockerfile.proxy
More file actions
48 lines (32 loc) · 1.57 KB
/
Dockerfile.proxy
File metadata and controls
48 lines (32 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM eclipse-temurin:25-jdk
WORKDIR /app
# Install jq for JSON manipulation
RUN apt-get update && apt-get install -y jq expect netcat-traditional && apt-get clean
# Download Velocity proxy JAR
ADD https://fill-data.papermc.io/v1/objects/ef1a852bfae7397e84907837925e7ad21c6312066290edaae401b77f6f423ac3/velocity-3.4.0-SNAPSHOT-558.jar velocity.jar
# Download SkyBlockProxy.jar
ADD https://github.com/Swofty-Developments/HypixelSkyBlock/releases/download/latest/SkyBlockProxy.jar plugins/SkyBlockProxy.jar
# Copy configuration data
COPY ./configuration /app/configuration_files
# Run Velocity and send "shutdown" to the console
RUN expect <<EOF
spawn java -jar velocity.jar
expect ">"
send "shutdown\r"
expect eof
EOF
# Remove velocity.toml
RUN rm velocity.toml
# Add back our velocity.toml
RUN cp configuration_files/velocity.toml velocity.toml
# Download resources.json
RUN mkdir -p configuration
RUN cp configuration_files/resources.json ./configuration/resources.json
# Get Contents of the forwarding secret and add it to resources.json
RUN secret=$(cat forwarding.secret) && \
jq --arg secret "$secret" '.["velocity-secret"] = $secret' ./configuration/resources.json > ./configuration/resources.json.tmp && \
mv ./configuration/resources.json.tmp ./configuration/resources.json
# Expose the required port
EXPOSE 25565
# Start the Velocity proxy and Copy the Forward.secret to the config files for use by other Dockerfiles
CMD ["sh", "-c", "cp forwarding.secret /app/configuration_files/forwarding.secret && java -jar velocity.jar"]