Files
openttd-client/docker/Dockerfile
kovagoadi 2526b8aec4
All checks were successful
Continuous Integration / lint-and-security (pull_request) Successful in 21s
Continuous Integration / tests-and-coverage (pull_request) Successful in 23s
Merge branch 'main' into renovate/debian-13.x
2026-07-15 09:13:54 +02:00

61 lines
1.5 KiB
Docker

# Build stage
FROM debian:13@sha256:fac46bff2e02f51425b6e33b0e1169f55dfb053d83511ca28aa50c09fd5ed7a4 AS builder
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
libcurl4-gnutls-dev \
liblzma-dev \
liblzo2-dev \
libpng-dev \
libzstd-dev \
zlib1g-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY OpenTTD-patches /src/OpenTTD-patches
WORKDIR /src/OpenTTD-patches/build
RUN cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DOPTION_DEDICATED=ON \
-DOPTION_INSTALL_HTML_DOCS=OFF \
-DOPTION_USE_ASSERTS=OFF \
&& make -j$(nproc) install
# Runtime stage
FROM debian:bookworm-slim@sha256:7b140f374b289a7c2befc338f42ebe6441b7ea838a042bbd5acbfca6ec875818
RUN apt-get update && apt-get install -y \
libcurl3-gnutls \
liblzma5 \
liblzo2-2 \
libpng16-16 \
libzstd1 \
zlib1g \
ca-certificates \
openttd-opengfx \
&& rm -rf /var/lib/apt/lists/*
# Copy binaries from builder
COPY --from=builder /usr/local/games/openttd /usr/local/bin/openttd
COPY --from=builder /usr/local/share/games/openttd /usr/local/share/games/openttd
# Ensure base graphics are in a path openttd searches
RUN mkdir -p /usr/local/share/games/openttd/baseset && \
cp -r /usr/share/games/openttd/baseset/* /usr/local/share/games/openttd/baseset/
# Create openttd user
RUN useradd -m -u 1000 openttd
USER openttd
WORKDIR /home/openttd
# Create config directory
RUN mkdir -p /home/openttd/.local/share/openttd/save
EXPOSE 3979/tcp 3979/udp 3977/tcp
CMD ["openttd", "-D"]