commit 35eda98e69a1810533d36e6fbfc19df5d16cf6d8 Author: david Date: Fri Feb 12 00:26:16 2021 +0100 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..73cd7fc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/steam diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9170a82 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM archlinux:latest +LABEL Description="This image is based on Archlinux and is used for running game servers with SteamCMD" \ + Author="david@socialnerds.org" \ + Version="0.1" \ + License="MIT" + +ENV USER_ID=1000 +ENV GROUP_ID=1000 +ENV USERNAME=steam + +VOLUME [ "/home/${USERNAME}" ] + +RUN pacman -Syu --noconfirm && \ + pacman -S --noconfirm --needed base-devel openssh git sudo cargo tmux vim wget python unzip bc jq netcat && \ + groupadd -g ${GROUP_ID} ${USERNAME} && \ + useradd -u ${USER_ID} -g ${GROUP_ID} -M -d /home/${USERNAME} -s /bin/bash ${USERNAME} && \ + chown ${USER_ID}:${GROUP_ID} /home/${USERNAME} && \ + echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \ + systemctl enable sshd.service && \ + cd /tmp && ls -la && sudo -u ${USERNAME} git clone https://aur.archlinux.org/paru.git && cd paru && \ + sudo -u ${USERNAME} makepkg -si --noconfirm && \ + sudo -u ${USERNAME} paru -S --noconfirm steamcmd bsdmainutils + +USER ${USERNAME} +WORKDIR /home/${USERNAME} + +CMD top -b diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..603e105 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,16 @@ +version: "3.0" + +services: + steam: + image: steam-container:latest + build: . + container_name: steam + volumes: + - ./steam:/home/steam + ports: + - 2233:22/tcp + - 2302:2302/tcp + - 2302:2302/udp + - 2303:2303/tcp + - 2303:2303/udp + restart: unless-stopped