first commit

This commit is contained in:
choelzl 2022-11-12 14:56:07 +01:00
commit 99491da726
Signed by: sora
GPG Key ID: A362EA0491E2EEA0
3 changed files with 105 additions and 0 deletions

17
.drone.yml Normal file
View File

@ -0,0 +1,17 @@
pipeline:
deploy-production:
image: docker/compose
volumes:
- /var/run/docker.sock:/var/run/docker.sock
commands:
- docker-compose -p ottd up -d --force-recreate --build
when:
event: push
branch: [master]
test-pr:
image: docker/compose
commands:
- echo "1"
when:
event: push

74
Dockerfile Normal file
View File

@ -0,0 +1,74 @@
FROM debian:stable as builder
WORKDIR /tmp
ENV jgrpp_version=0.49.0
ENV opengfx_version=7.1
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y \
cmake \
curl \
unzip \
xz-utils \
build-essential \
ninja-build \
pkg-config \
zlib1g \
zlib1g-dev \
liblzma5 \
liblzma-dev \
liblzo2-2 \
liblzo2-dev \
libzstd-dev \
libpng16-16 \
libpng-dev
RUN curl -fLo jgrpp-$jgrpp_version.tar.gz https://github.com/JGRennison/OpenTTD-patches/archive/jgrpp-$jgrpp_version.tar.gz
RUN curl -fLo opengfx-$opengfx_version-all.zip https://cdn.openttd.org/opengfx-releases/$opengfx_version/opengfx-$opengfx_version-all.zip
RUN tar -xvzf jgrpp-$jgrpp_version.tar.gz
RUN mkdir /tmp/build
WORKDIR /tmp/build
RUN cmake \
-B build \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_INSTALL_BINDIR=bin \
-D CMAKE_INSTALL_DATADIR=/usr/share \
-D OPTION_DEDICATED=ON \
-D DEFAULT_PERSONAL_DIR=/data \
-G Ninja \
-S /tmp/OpenTTD-patches-jgrpp-$jgrpp_version
RUN ninja -C build
RUN ninja -C build install
WORKDIR /tmp
RUN unzip opengfx-$opengfx_version-all.zip
RUN mv opengfx-$opengfx_version.tar /usr/share/openttd/baseset/opengfx-$opengfx_version.tar
FROM debian:stable
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
zlib1g \
liblzma5 \
liblzo2-2 \
libzstd1 \
libpng16-16 \
&& apt-get clean \
&& rm -rvf /var/lib/apt/lists/* /var/log/apt /var/log/dpkg.log
COPY --from=builder /usr/bin/openttd /usr/bin/openttd
COPY --from=builder /usr/share/openttd/ /usr/share/openttd/
COPY --from=builder /usr/share/doc/openttd/ /usr/share/doc/openttd/
COPY --from=builder /usr/share/man/man6/openttd.6.gz /usr/share/man/man6/openttd.6.gz
RUN useradd -ms /bin/sh -d /data openttd
USER openttd:openttd
EXPOSE 3979
EXPOSE 3979/udp
WORKDIR /data
ENV XDG_DATA_HOME=/data
VOLUME ["/data"]
ENTRYPOINT ["/usr/bin/openttd"]

14
docker-compose.yml Normal file
View File

@ -0,0 +1,14 @@
version: "3.7"
networks:
external:
external: true
services:
ottd:
build: ./
container_name: ottd
networks:
- external
labels:
- "traefik.enable=false"
restart: always