further secure containers

This commit is contained in:
Matthew Tran
2025-02-19 22:17:31 -08:00
parent 36c4019c01
commit e7b4e8aa46
15 changed files with 129 additions and 94 deletions
+7 -6
View File
@@ -3,18 +3,19 @@ FROM ubuntu:24.04
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y wget unzip
USER ubuntu
WORKDIR /home/ubuntu
RUN groupadd -g 2002 me && useradd -u 2002 -g 2002 -m me
USER me
WORKDIR /home/me
# from https://terraria.fandom.com/wiki/Server (currently 1.4.4.9)
RUN wget https://terraria.org/api/download/pc-dedicated-server/terraria-server-1449.zip
RUN unzip terraria-server-1449.zip && rm terraria-server-1449.zip
RUN mv 1449/ server/
COPY --chown=ubuntu:ubuntu entry.sh ./
COPY --chown=me:me entry.sh ./
WORKDIR /home/ubuntu/server/Linux
WORKDIR /home/me/server/Linux
RUN chmod +x TerrariaServer.bin.x86_64
COPY --chown=ubuntu:ubuntu password.default ./password.txt
COPY --chown=ubuntu:ubuntu config.txt password.tx[t] ./
COPY --chown=me:me password.default ./password.txt
COPY --chown=me:me config.txt password.tx[t] ./