Last active
March 15, 2018 14:51
-
-
Save ssube/982d99c1df74f67a1efe504a1d36afa4 to your computer and use it in GitHub Desktop.
k8s-terraria
This file contains hidden or 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
FROM apextoaster/base:master | |
ENV TSHOCK_VERSION 4.3.25 | |
RUN apt-get update \ | |
&& apt-get install -y mono-complete tzdata | |
WORKDIR /terraria | |
RUN wget --quiet https://github.com/Pryaxis/TShock/releases/download/v${TSHOCK_VERSION}/tshock_${TSHOCK_VERSION}.zip \ | |
&& unzip tshock_${TSHOCK_VERSION}.zip \ | |
&& rm tshock_${TSHOCK_VERSION}.zip \ | |
&& chmod u+x /terraria/TerrariaServer.exe | |
EXPOSE 7777 | |
ENTRYPOINT ["mono", "/terraria/TerrariaServer.exe"] | |
CMD ["-configpath", "/config", "-worldpath", "/data", "-autocreate", "2"] |
This file contains hidden or 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
#! /bin/bash | |
docker run -it -v $(pwd)/config:/config:rw -v $(pwd)/data:/data:rw -p 0.0.0.0:7777:7777 ssube/tshock:latest |
This file contains hidden or 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
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: tshock | |
labels: | |
k8s-app: tshock | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
k8s-app: tshock | |
template: | |
metadata: | |
labels: | |
k8s-app: tshock | |
spec: | |
containers: | |
- name: tshock-server | |
image: ssube/tshock:latest | |
imagePullPolicy: Always | |
ports: | |
- containerPort: 7777 | |
name: game | |
volumeMounts: | |
- mountPath: /config | |
name: config | |
readOnly: false | |
- mountPath: /data | |
name: data | |
readOnly: false | |
nodeSelector: | |
role: server | |
volumes: | |
- name: config | |
hostPath: | |
type: Directory | |
path: /data/tshock/config | |
- name: data | |
hostPath: | |
type: Directory | |
path: /data/tshock/data | |
--- | |
kind: Service | |
apiVersion: v1 | |
metadata: | |
name: tshock | |
labels: | |
k8s-app: tshock | |
spec: | |
type: NodePort | |
sessionAffinity: None | |
externalTrafficPolicy: Cluster | |
selector: | |
k8s-app: tshock | |
ports: | |
- name: game | |
protocol: "TCP" | |
port: 9170 | |
targetPort: game |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment