This repository has been archived by the owner on Jun 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbungee-docker.tar
144 lines (117 loc) · 10.5 KB
/
bungee-docker.tar
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
container-start.bash 000755 001750 001750 00000002723 13652320330 013236 0 ustar 00 000000 000000 #!/bin/bash
# gsutil cp container-start.bash gs://tms-storage-1/Container/container-start.bash
function init {
# Using cloudsql in the background
cloud_sql_proxy -instances=tmssword:asia-northeast1:tmssql -dir=/cloudsql -ip_address_types=PRIVATE &
}
function copy {
GSUTIL_OPTS="-m -q
-o 'GSUtil:parallel_thread_count=8'
-o 'GSUtil:sliced_object_download_max_components=32'"
echo "bucket -> ${IMAGENAME}"
gsutil ${GSUTIL_OPTS} \
rsync -r -x ".*\.sav$|.*\.log.*|plugins/.*\.json$|.*stats/|
.*advancements/|.*userdata/|.*\.csv$|.*[pP]layer[dD]ata/" \
"gs://${BUCKET_URI}" "." || exit
}
function chowning {
if [ $UID == 0 ]; then
chown -R ${IMAGENAME}:${IMAGENAME} /${IMAGENAME}
fi
}
function end {
echo "Set the initial memory to ${INIT_BUNGEE_MEM:-${JAR_MEM}} and the maximum memory to ${MAX_BUNGEE_MEM:-${JAR_MEM}}"
JVM_OPTS="-Xms${INIT_JAR_MEM:-${JAR_MEM}} -Xmx${MAX_JAR_MEM:-${JAR_MEM}}"
JVM_OPT2="-XX:+UnlockExperimentalVMOptions
-XX:MaxGCPauseMillis=100
-XX:+DisableExplicitGC
-XX:TargetSurvivorRatio=90
-XX:G1NewSizePercent=50
-XX:G1MaxNewSizePercent=80
-XX:G1MixedGCLiveThresholdPercent=35
-XX:+AlwaysPreTouch
-XX:+ParallelRefProcEnabled
-XX:+UseLargePagesInMetaspace"
if [ $UID == 0 ]; then
exec sudo -u ${IMAGENAME} java $JVM_OPTS $JVM_OPT2 -jar $BOOTJAR
else
exec java $JVM_OPTS $JVM_OPT2 -jar
fi
}
init
copy
chowning
end Dockerfile 000755 001750 001750 00000001433 13652323675 011270 0 ustar 00 000000 000000 # --file Dockerfile -t "asia.gcr.io/tmssword/tms:latest" .
FROM google/cloud-sdk:alpine AS build-sdk
RUN gcloud components --quiet install cloud_sql_proxy
##########
FROM anapsix/alpine-java:latest
RUN apk --update add python3 bash sudo && \
apk upgrade && rm -rf /var/cache/apk/*
COPY --from=build-sdk /google-cloud-sdk/ /google-cloud-sdk/
ENV PATH /google-cloud-sdk/bin:$PATH
##########
ENV IMAGENAME "minecraft"
ENV BUCKET_BASE "tms-storage-1/Container/"
VOLUME ["/${IMAGENAME}/plugins", "/cloudsql"]
WORKDIR /${IMAGENAME}
COPY *.json .
# Add user
RUN set -x \
&& addgroup -g 1000 -S ${IMAGENAME} \
&& adduser -u 1000 -D -S -G ${IMAGENAME} ${IMAGENAME} \
&& addgroup ${IMAGENAME} wheel \
&& gcloud auth activate-service-account --key-file storage-key.json
# EOF 2020/04/30 Dockerfile-bungee 000755 001750 001750 00000000663 13652323057 012531 0 ustar 00 000000 000000
# --file Dockerfile-bungee -t "asia.gcr.io/tmssword/bungeeimages:latest" .
# --file Dockerfile-lobby -t "asia.gcr.io/tmssword/lobbyimages:latest" .
FROM asia.gcr.io/tmssword/tms:latest
ENV BUCKET_URI "${BUCKET_BASE}lobby-static/"
ENV BOOTJAR "Bungeecord.jar"
ENV JAR_MEM "256m"
EXPOSE 25588
CMD gsutil cp gs://${BUCKET_BASE}container-start.bash /usr/bin/ && chmod 777 /usr/bin/container-start.bash && /usr/bin/container-start.bash