Skip to content

Commit c9f4b62

Browse files
authored
Merge pull request #125 from lch24/dev
docker and map
2 parents 1b98702 + 06e0638 commit c9f4b62

28 files changed

Lines changed: 2386 additions & 139 deletions

dependency/Dockerfile/Dockerfile_run_client

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
# =============================================================================
22
# THUAI9 Client Image — runs player AI (Python or C++)
3+
# Adapted from THUAI8 pattern
34
#
45
# Build:
5-
# docker build -f dependency/Dockerfile/Dockerfile_run_client \
6+
# docker build --build-arg BASE_IMAGE=eesast/thuai9_base:base \
7+
# -f dependency/Dockerfile/Dockerfile_run_client \
68
# -t eesast/thuai9_client:latest .
79
#
8-
# Run (Python):
10+
# Run (competition — code files in /usr/local/code/ named by player label):
911
# docker run --rm \
10-
# -e TEAM_ID=1 -e SERVER_IP=host.docker.internal \
11-
# -e PLAYER_LANG=python \
12-
# eesast/thuai9_client:latest
13-
#
14-
# Run (C++ — mount compiled binary):
15-
# docker run --rm \
16-
# -e TEAM_ID=1 -e SERVER_IP=host.docker.internal \
17-
# -e PLAYER_LANG=cpp \
18-
# -v "$(pwd)/output/capi:/usr/local/PlayerCode/CAPI/cpp/build/capi" \
12+
# -v /path/to/team/code:/usr/local/code \
13+
# -v /path/to/output:/usr/local/output \
14+
# -e TERMINAL=CLIENT -e TEAM_LABEL=TeamA -e TEAM_SEQ_ID=0 \
15+
# -e CONNECT_IP=172.17.0.1 -e GAME_TIME=600 \
1916
# eesast/thuai9_client:latest
2017
# =============================================================================
2118
ARG BASE_IMAGE=eesast/thuai9_base:base
2219
FROM ${BASE_IMAGE}
2320
LABEL maintainer="eesast"
2421
LABEL description="THUAI9 player client runner"
2522

23+
WORKDIR /usr/local
24+
25+
RUN mkdir -p /usr/local/code /usr/local/output
26+
2627
# Copy player code
2728
COPY ./CAPI/python ./PlayerCode/CAPI/python
2829
COPY ./dependency/proto ./PlayerCode/dependency/proto
@@ -45,6 +46,5 @@ WORKDIR /usr/local
4546
COPY ./dependency/shell/run.sh .
4647

4748
ENV TERMINAL=CLIENT
48-
ENV PLAYER_LANG=python
4949

5050
ENTRYPOINT ["bash", "./run.sh"]

dependency/Dockerfile/Dockerfile_run_server

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,39 @@
11
# =============================================================================
22
# THUAI9 Server Image — C# game server runner
3+
# Adapted from THUAI8 pattern
34
#
45
# Build:
56
# docker build -f dependency/Dockerfile/Dockerfile_run_server \
67
# -t eesast/thuai9_server:latest .
78
#
8-
# Run:
9-
# docker run --rm -p 8888:8888 \
10-
# -e TEAM_COUNT=4 -e GAME_TIME_SEC=600 \
9+
# Run (competition):
10+
# docker run --rm \
11+
# -v /path/to/map:/usr/local/map \
12+
# -v /path/to/output:/usr/local/output \
13+
# -e TERMINAL=SERVER -e MODE=COMPETITION -e MAP_ID=xxx \
14+
# -e SCORE_URL=... -e TOKEN=... -e FINISH_URL=... \
15+
# -e GAME_TIME=600 -e EXPOSED=1 \
1116
# eesast/thuai9_server:latest
1217
# =============================================================================
1318
FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build
1419
LABEL maintainer="eesast"
15-
WORKDIR /usr/local/src
16-
17-
# Copy the entire repo (for logic/ + dependency/)
20+
WORKDIR /usr/local
1821
COPY . .
19-
20-
# Publish the server as a self-contained linux-x64 binary
2122
RUN dotnet publish logic/Server/Server.csproj \
2223
-c Release \
2324
-o /usr/local/Server \
2425
--self-contained true \
2526
-r linux-x64
2627

27-
# ── Runtime stage ────────────────────────────────────────────────────
2828
FROM mcr.microsoft.com/dotnet/runtime:8.0-jammy
2929
LABEL maintainer="eesast"
3030
LABEL description="THUAI9 game server"
3131

3232
WORKDIR /usr/local
33-
3433
COPY --from=build /usr/local/Server ./Server
3534

36-
# Prepare team and playback directories
37-
RUN mkdir -p /usr/local/team1 /usr/local/team2 \
38-
/usr/local/team3 /usr/local/team4 \
39-
/usr/local/playback
35+
RUN mkdir -p /usr/local/map /usr/local/output
4036

41-
# Copy entrypoint script
4237
COPY ./dependency/shell/run.sh .
4338

4439
ENV TERMINAL=SERVER

0 commit comments

Comments
 (0)