Skip to content

Commit 667b8f9

Browse files
authored
Slim image fixups (#304)
1 parent a426868 commit 667b8f9

File tree

3 files changed

+24
-22
lines changed

3 files changed

+24
-22
lines changed

server/Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG NODE_VERSION=10
2-
FROM node:${NODE_VERSION}-slim AS screeps
2+
FROM node:${NODE_VERSION}-slim AS base
33

44
ENV DEBIAN_FRONTEND=noninteractive
55

@@ -12,12 +12,16 @@ RUN apt-get update
1212
# Install node-gyp dependencies
1313
# We do not pin as we use multiple node versions.
1414
# They are so old that there is no changes to their package registry anyway..
15+
# While we're at it, try fixing the root certificates
1516
# hadolint ignore=DL3018
1617
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
1718
--mount=type=cache,target=/var/lib/apt,sharing=locked \
1819
apt-get update \
19-
&& apt-get install -y --no-install-recommends bash python make gcc g++ \
20-
&& rm -rf /var/lib/apt/lists/*
20+
&& apt-get install -y --no-install-recommends ca-certificates bash python make gcc g++ \
21+
&& rm -rf /var/lib/apt/lists/* \
22+
&& update-ca-certificates
23+
24+
FROM base AS screeps
2125

2226
# Install screeps
2327
WORKDIR /screeps

server/screeps-start.cjs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,6 @@ const ConfigPath = path.join(RootDir, "config.yml");
1313

1414
process.chdir(RootDir);
1515

16-
/**
17-
* @typedef LauncherOptions
18-
* @property {boolean} autoUpdate
19-
* @property {boolean} logConsole
20-
* @property {number} runnerThreads
21-
* @property {number} processorCount
22-
* @property {number} storageTimeout
23-
* @property {number} logRotateKeep
24-
* @property {number} restartInterval
25-
*/
26-
27-
/**
28-
* @typedef Config
29-
* @property {string} steamKey
30-
* @property {string[]} mods
31-
* @property {Record<string, string>} bots
32-
* @property {LauncherOptions} launcherOptions
33-
*/
34-
3516
const config = /** @type {Config} */ (yaml.load(fs.readFileSync(ConfigPath, "utf8")));
3617

3718
/**

server/types.d.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
interface LauncherOptions {
3+
autoUpdate: boolean;
4+
logConsole: boolean;
5+
runnerThreads: number;
6+
processorCount: number;
7+
storageTimeout: number;
8+
logRotateKeep: number;
9+
restartInterval: number;
10+
}
11+
12+
interface Config {
13+
steamKey: string;
14+
mods: string[];
15+
bots: Record<string, string>;
16+
launcherOptions: LauncherOptions;
17+
}

0 commit comments

Comments
 (0)