返回提交历史
Modified
Dockerfile
+1
-0
Modified
src/index.ts
+9
-3
XFEstudio/XFESpaceNinjaServer
chore: print build date when started via docker (#2517)
Docker updates can be a bit confusing so this should help users know if they're up-to-date. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2517 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
922b65cf
代码差异
2 个文件
+10
-3
@@ -7,5 +7,6 @@ WORKDIR /app
7
7
8
8
RUN npm i --omit=dev
9
9
RUN npm run build
10
RUN date '+%d %B %Y' > BUILD_DATE
10
11
11
12
ENTRYPOINT ["/app/docker-entrypoint.sh"]
@@ -18,17 +18,23 @@ logger.info("Starting up...");
18
18
19
19
// Proceed with normal startup: bring up config watcher service, validate config, connect to MongoDB, and finally start listening for HTTP.
20
20
import mongoose from "mongoose";
21
import path from "path";
21
22
import { JSONStringify } from "json-with-bigint";
22
23
import { startWebServer } from "@/src/services/webService";
23
24
24
import { validateConfig } from "@/src/services/configWatcherService";
25
25
import { updateWorldStateCollections } from "@/src/services/worldStateService";
26
import { repoDir } from "@/src/helpers/pathHelper";
26
27
27
// Patch JSON.stringify to work flawlessly with Bigints.
28
JSON.stringify = JSONStringify;
28
JSON.stringify = JSONStringify; // Patch JSON.stringify to work flawlessly with Bigints.
29
29
30
30
validateConfig();
31
31
32
fs.readFile(path.join(repoDir, "BUILD_DATE"), "utf-8", (err, data) => {
33
if (!err) {
34
logger.info(`Docker image was built on ${data.trim()}`);
35
}
36
});
37
32
38
mongoose
33
39
.connect(config.mongodbUrl)
34
40
.then(() => {