/ docker / server.Dockerfile
server.Dockerfile
 1  FROM node:24.14.0-alpine AS build
 2  
 3  RUN mkdir -p /opt/lineage2ts
 4  WORKDIR /opt/lineage2ts
 5  
 6  COPY ../.npm .npm
 7  COPY ../cli cli
 8  COPY ../game-server game-server
 9  COPY ../login-server login-server
10  COPY ../package.json package.json
11  COPY ../package-lock.json package-lock.json
12  COPY ../LICENSE LICENSE
13  COPY ../Readme.md Readme.md
14  
15  RUN apk add python3 && ln -sf python3 /usr/bin/python
16  RUN apk add py3-pip
17  RUN apk add build-base
18  RUN apk add 7zip
19  RUN apk add curl
20  RUN apk add git
21  
22  # reason for building from source is due to alpine linux being different from other linux distributions
23  RUN npm ci --cache .npm --build-from-source
24  
25  WORKDIR /opt/lineage2ts/cli
26  RUN chmod +x provisionDefaultArtifacts.sh && sh provisionDefaultArtifacts.sh
27  RUN chmod +x provisionGeopackArtifacts.sh && sh provisionGeopackArtifacts.sh
28  
29  WORKDIR /opt/lineage2ts
30  RUN cd game-server && npm run build && rm -rf source
31  RUN cd login-server && npm run build && rm -rf source
32  
33  RUN rm -rf node_modules
34  RUN npm ci --cache .npm --omit=dev --workspace=login-server --workspace=game-server --build-from-source
35  
36  RUN 7z a geopack.7z geopack.database
37  RUN 7z a datapack.7z datapack.database
38  RUN 7z a node_modules.7z node_modules
39  
40  FROM node:24.14.0-alpine
41  
42  RUN mkdir -p /opt/lineage2ts/game-server && mkdir -p /opt/lineage2ts/login-server
43  WORKDIR /opt/lineage2ts
44  
45  COPY --from=build /opt/lineage2ts/game-server /opt/lineage2ts/game-server
46  COPY --from=build /opt/lineage2ts/login-server /opt/lineage2ts/login-server
47  COPY --from=build /opt/lineage2ts/node_modules.7z /opt/lineage2ts/node_modules.7z
48  
49  COPY --from=build /opt/lineage2ts/login.database /opt/lineage2ts/login-server/login.database
50  COPY --from=build /opt/lineage2ts/game.database /opt/lineage2ts/game-server/game.database
51  COPY --from=build /opt/lineage2ts/datapack.7z /opt/lineage2ts/game-server/datapack.7z
52  COPY --from=build /opt/lineage2ts/geopack.7z /opt/lineage2ts/game-server/geopack.7z
53  
54  COPY --from=build /opt/lineage2ts/package.json /opt/lineage2ts/package.json
55  COPY --from=build /opt/lineage2ts/package-lock.json /opt/lineage2ts/package-lock.json
56  COPY --from=build /opt/lineage2ts/LICENSE /opt/lineage2ts/LICENSE
57  COPY --from=build /opt/lineage2ts/Readme.md /opt/lineage2ts/Readme.md
58  
59  COPY docker/server-entry.sh server-entry.sh
60  RUN chmod +x server-entry.sh
61  
62  RUN apk add 7zip
63  
64  LABEL name="Lineage2TS Game/Login servers" maintainer="MrTREX" version="latest"  website="https://gitlab.com/MrTREX/lineage2ts"
65  
66  EXPOSE 7777 2106 9999 9998
67  
68  # Please note that login server variables are prefixed via: LS.<config>.<property>
69  # Please note that game server variables are prefixed via: GS.<config>.<property>
70  ENV GS.server.ExternalServerIP=127.0.0.1
71  
72  # Pass Nodejs runtime parameters for login server via LS_NODE_OPTIONS
73  # ENV LS_NODE_OPTIONS=--expose-gc
74  
75  # Pass Nodejs runtime parameters for game server via GS_NODE_OPTIONS
76  ENV GS_NODE_OPTIONS="--max_old_space_size=4096"
77  
78  VOLUME ["/opt/lineage2ts/login-server", "/opt/lineage2ts/game-server"]
79  ENV NODE_ENV=production
80  
81  CMD [ "/bin/sh", "server-entry.sh" ]