Initial commit

This commit is contained in:
2024-11-11 15:25:53 +01:00
commit 113065f09e
4 changed files with 129 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
FROM ubuntu:24.04
EXPOSE 28015
EXPOSE 28016
RUN apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y && apt-get autoremove -y && apt-get install -y locales
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN locale-gen en_US.UTF-8 && update-locale LANG=en_US.UTF-8
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get install -y \
ca-certificates \
software-properties-common \
lib32gcc-s1 \
libstdc++6 \
curl \
wget \
build-essential \
jq
RUN mkdir -p /steamcmd
RUN mkdir -p /starbound
WORKDIR "/starbound"
RUN cd /steamcmd \
&& wget -o /tmp/steamcmd.tar.gz http://media.steampowered.com/installer/steamcmd_linux.tar.gz \
&& tar zxvf steamcmd_linux.tar.gz \
&& rm steamcmd_linux.tar.gz \
&& chmod +x ./steamcmd.sh
WORKDIR /
RUN /steamcmd/steamcmd.sh +force_install_dir /starbound/ +quit
COPY start.sh /start.sh
COPY install.sh /install.sh
ENTRYPOINT ["./start.sh"]
+35
View File
@@ -0,0 +1,35 @@
services:
install:
build: .
environment:
- TZ=Europe/London
volumes:
- steam-data:/root/Steam
- type: bind
source: D:/temp/starbound
target: /starbound
bind:
create_host_path: true
tty: true
stdin_open: true
entrypoint: ./install.sh
network_mode: bridge
server:
build: .
environment:
- TZ=Europe/London
volumes:
- steam-data:/root/Steam
- type: bind
source: D:/temp/starbound
target: /starbound
bind:
create_host_path: true
ports:
- '28015:28015/udp'
- '28016:28016/udp'
restart: unless-stopped
network_mode: bridge
volumes:
steam-data:
+39
View File
@@ -0,0 +1,39 @@
#!/bin/bash
read -p "Enter Steam username: " STEAM_USER
read -sp "Enter Steam password: " STEAM_PASSWORD
echo
/steamcmd/steamcmd.sh \
+force_install_dir /starbound/ \
+login "$STEAM_USER" "$STEAM_PASSWORD" \
+app_update 211820 validate \
+quit
# Check if the SteamCMD login was successful
if [ $? -ne 0 ]; then
echo "SteamCMD failed. Check the output for more details."
exit 1
fi
response=$(curl -s "https://api.github.com/repos/xStarbound/xStarbound/releases/latest")
# Extract the tag name and download URL using jq
tag_name=$(echo "$response" | jq -r '.tag_name')
download_url=$(echo "$response" | jq -r '.assets[] | select(.name == "linux-static.tar.gz") | .browser_download_url')
if [ -n "$download_url" ]; then
echo "Downloading linux-static.tar.gz from the latest release..."
curl -L "$download_url" -o /tmp/linux-static.tar.gz
echo "Extracting linux-static.tar.gz ..."
tar -xzf /tmp/linux-static.tar.gz -C /starbound/steamapps/common/Starbound/server
echo "Cleaning up downloaded file..."
rm /tmp/linux-static.tar.gz
echo "Download and extraction completed successfully."
else
echo "No linux-static.tar.gz asset found in the latest release."
exit 1
fi
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
cd /starbound/steamapps/common/Starbound/server
chmod +x xserver.sh
./xserver.sh
while :
do
echo "Press [CTRL+C] to stop.."
sleep 1
done