-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (48 loc) · 1.61 KB
/
Copy pathDockerfile
File metadata and controls
59 lines (48 loc) · 1.61 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
# Stage 1: Download Godot binary
FROM --platform=linux/amd64 debian:bookworm-slim AS godot-download
ARG GODOT_VERSION=4.6.3
ARG GODOT_STATUS=stable
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates unzip wget \
&& rm -rf /var/lib/apt/lists/*
RUN wget -O godot.zip "https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}-${GODOT_STATUS}/Godot_v${GODOT_VERSION}-${GODOT_STATUS}_linux.x86_64.zip" \
&& unzip godot.zip \
&& mv "Godot_v${GODOT_VERSION}-${GODOT_STATUS}_linux.x86_64" /usr/local/bin/godot \
&& chmod +x /usr/local/bin/godot
# Stage 2: Runtime
FROM --platform=linux/amd64 node:22-bookworm-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
dumb-init \
procps \
libasound2 \
libegl1 \
libfontconfig1 \
libfreetype6 \
libgl1 \
libx11-6 \
libxcursor1 \
libxext6 \
libxfixes3 \
libxi6 \
libxinerama1 \
libxkbcommon0 \
libxrandr2 \
libxrender1 \
&& useradd --create-home --shell /usr/sbin/nologin godot \
&& rm -rf /var/lib/apt/lists/*
COPY --from=godot-download /usr/local/bin/godot /usr/local/bin/godot
WORKDIR /app
COPY --chown=godot:godot . .
RUN chown godot:godot /app
# The entrypoint fixes the named import-cache volume owner, then drops to godot.
USER root
# Godot import moved to docker-entrypoint.sh with conditional cache check.
# This avoids re-importing on every image rebuild.
# Actual port range set via PORT_RANGE_START/END env vars (see docker-compose.yml)
EXPOSE 3000/tcp
EXPOSE 7777-7791/udp
ENV GODOT_BIN=godot
ENV GODOT_PROJECT_PATH=/app
ENTRYPOINT ["/app/docker-entrypoint.sh"]