FROM debian:11.3
RUN apt-get update -y \
    && apt-get install -y \
        expect \
        unzip \
        wget \
        xmlstarlet \
    && rm -rf /var/lib/apt/lists/*

RUN mkdir /app
WORKDIR /app
COPY ./tmforever-entrypoint.sh /usr/local/bin/tmforever-foreground

ENV \
    TM_BIND_IP="" \
    TM_BIND_PORT="" \
    TM_P2P_PORT="" \
    TM_CLIENT_PORT="" \
    TM_USE_NAT_UPNP="" \
    \
    TM_XMLRPC_PORT="" \
    TM_XMLRPC_ALLOWED_REMOTE="" \
    \
    TM_SERVER_USER="" \
    TM_SERVER_PASSWORD="" \
    TM_SERVER_VALIDATION_KEY="" \
    \
    TM_TITLE="" \
    TM_COMMENT="" \
    TM_HIDDEN="" \
    \
    TM_PACKMASK="" \
    \
    TM_MAX_PLAYERS="" \
    TM_PLAYER_PASSWORD="" \
    \
    TM_MAX_SPECTATORS="" \
    TM_SPECTATOR_PASSWORD="" \
    \
    TM_LADDER_MODE="" \
    TM_LADDER_LIMIT_MIN="" \
    TM_LADDER_LIMIT_MAX="" \
    \
    TM_ENABLE_P2P_UPLOAD="" \
    TM_ENABLE_P2P_DOWNLOAD="" \
    \
    TM_CALLVOTE_TIMEOUT="" \
    TM_CALLVOTE_RATIO="" \
    \
    TM_ALLOW_CHALLENGE_DOWNLOAD="" \
    TM_AUTOSAVE_REPLAYS="" \
    TM_AUTOSAVE_VALIDATION_REPLAYS="" \
    \
    TM_REFEREE_PASSWORD="" \
    TM_REFEREE_VALIDATION_MODE="" \
    \
    TM_USE_CHANGING_VALIDATION_SEED="" \
    \
    TM_SUPERADMIN_PASSWORD="" \
    TM_ADMIN_PASSWORD="" \
    \
    TM_CONNECTION_UPLOADRATE="" \
    TM_CONNECTION_DOWNLOADRATE="" \
    TM_P2P_CACHE_SIZE="" \
    TM_BLACKLIST_URL="" \
    TM_GUESTLIST_FILENAME="" \
    TM_BLACKLIST_FILENAME="" \
    TM_ALLOW_SPECTATOR_RELAYS="" \
    TM_USE_PROXY="" \
    TM_PROXY_LOGIN="" \
    TM_PROXY_PASSWORD="" \
    \
    TM_LOG_FILES=""

ENTRYPOINT [ "tmforever-foreground" ]