diff --git a/Dockerfile b/Dockerfile index 3cf21b5..04cdfc0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,6 +38,7 @@ ENV HEADLESS_CLIENTS_PROFILE="\$profile-hc-\$i" ENV PORT=2302 ENV STEAM_BRANCH=public ENV STEAM_BRANCH_PASSWORD= +ENV STEAM_ADDITIONAL_DEPOT= ENV MODS_LOCAL=true ENV MODS_PRESET= ENV SKIP_INSTALL=false @@ -51,6 +52,13 @@ EXPOSE 2306/udp WORKDIR /arma3 VOLUME /steamcmd +VOLUME /arma3/addons +VOLUME /arma3/enoch +VOLUME /arma3/expansion +VOLUME /arma3/jets +VOLUME /arma3/heli +VOLUME /arma3/orange +VOLUME /arma3/argo STOPSIGNAL SIGINT diff --git a/launch.py b/launch.py index 3ce22e5..a4582f1 100644 --- a/launch.py +++ b/launch.py @@ -1,5 +1,6 @@ import os import re +import shutil import subprocess from string import Template @@ -34,9 +35,29 @@ def env_defined(key): steamcmd.extend(["-beta", os.environ["STEAM_BRANCH"]]) if env_defined("STEAM_BRANCH_PASSWORD"): steamcmd.extend(["-betapassword", os.environ["STEAM_BRANCH_PASSWORD"]]) - steamcmd.extend(["validate", "+quit"]) + steamcmd.extend(["validate"]) + if env_defined("STEAM_ADDITIONAL_DEPOT"): + for depot in os.environ["STEAM_ADDITIONAL_DEPOT"].split("|"): + depot_parts = depot.split(",") + steamcmd.extend( + ["+login", os.environ["STEAM_USER"], os.environ["STEAM_PASSWORD"]] + ) + steamcmd.extend( + ["+download_depot", "233780", depot_parts[0], depot_parts[1]] + ) + steamcmd.extend(["+quit"]) subprocess.call(steamcmd) +if env_defined("STEAM_ADDITIONAL_DEPOT"): + for depot in os.environ["STEAM_ADDITIONAL_DEPOT"].split("|"): + depot_parts = depot.split(",") + depot_dir = ( + f"/steamcmd/linux32/steamapps/content/app_233780/depot_{depot_parts[0]}/" + ) + for file in os.listdir(depot_dir): + shutil.copytree(depot_dir + file, "/arma3/", dirs_exist_ok=True) + print(f"Moved {file} to /arma3") + # Mods mods = []