forked from obsidian-level-maker/Obsidian
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.yml
More file actions
62 lines (46 loc) · 1.74 KB
/
Copy pathDockerfile.yml
File metadata and controls
62 lines (46 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Multi-stage build for Obsidian Level Maker (console-only / headless)
# Generates WAD files for Doom and other classic FPS games
# ============================================================
# Stage 1: Build
# ============================================================
FROM debian:bookworm-slim AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
ninja-build \
git \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY . .
RUN cmake -B build \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCONSOLE_ONLY=ON \
-DCMAKE_INSTALL_PREFIX=/opt/obsidian \
&& cmake --build build --parallel "$(nproc)"
# Install to a clean prefix
RUN cmake --install build --prefix /opt/obsidian
# ============================================================
# Stage 2: Runtime
# ============================================================
FROM debian:bookworm-slim AS runtime
RUN apt-get update && apt-get install -y --no-install-recommends \
libstdc++6 \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user
RUN groupadd -r obsidian && useradd -r -g obsidian -m -d /home/obsidian obsidian
# Install Obsidian
COPY --from=builder /opt/obsidian /opt/obsidian
# Create output directory for generated WADs
RUN mkdir -p /wads && chown obsidian:obsidian /wads
# Create config directory for user-supplied configuration
RUN mkdir -p /config && chown obsidian:obsidian /config
WORKDIR /opt/obsidian
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
USER obsidian
VOLUME ["/wads", "/config"]
ENTRYPOINT ["docker-entrypoint.sh"]
# Default: generate a single WAD with default settings
CMD ["--batch", "/wads/output.wad"]