forked from aburch/simutrans
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
74 lines (65 loc) · 2.64 KB
/
Dockerfile
File metadata and controls
74 lines (65 loc) · 2.64 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
63
64
65
66
67
68
69
70
71
72
73
74
# Simutrans Server, Dockerized
# I setup a bunch of defaults so it can be setup really quickly. You can
# mix and match some of the launch options to customize as needed.
#
# Defaults: Graphics Pak = pak64; simuconf.tab = default from build;
# game file = a random 256x256 map I created.
#
# Launch with all the defaults:
# docker run -d -p 13353:13353 dahuss/simutrans-server-docker
# Launch with a custom pak:
# docker run -d -p 13353:13353 -v <local path>/pak128:/simutrans/pak dahuss/simutrans-server-docker
# Launch with a custom config (place custom simuconf.tab in directory by itself):
# docker run -d -p 13353:13353 -v <path to config directory>:/simutrans/config dahuss/simutrans-server-docker
# Launch with custom game file:
# docker run -d -p 13353:13353 -v <path to save directory>:/simutrans/save dahuss/simutrans-server-docker -load <save game file>
FROM debian:testing-slim
LABEL maintainer="Daniel Huss - https://github.com/danhuss" \
description="A docker image for running a Simutrans server."
##create the user
RUN mkdir /home/app && \
groupadd -r app && \
useradd -d /home/app -r -g app app && \
chown app:app -R /home/app && \
##Get everything needed to compile
apt-get -y update && \
apt-get -y install \
autoconf \
build-essential \
curl \
git \
libbz2-dev \
libz-dev \
unzip && \
# apt-get -y build-dep simutrans && \
apt-get -y remove libsdl1.2-dev && \
## used instead of COPY for building on docker for windows (carriage return issues)
# git clone https://github.com/danhuss/simutrans-server-docker.git && \
rm -rf /var/lib/apt/lists/*
COPY . /simutrans-server-docker
##Compile the code
RUN cd /simutrans-server-docker && \
./get_lang_files.sh && \
autoconf && \
./configure --prefix=/usr --enable-server && \
make && \
mv simutrans / && \
mv sim /simutrans && \
mkdir /simutrans/save && \
chown app:app -R /simutrans
##Let's install a default pak and some default settings
RUN cd / && \
curl -L -o simupak64.zip https://downloads.sourceforge.net/project/simutrans/pak64/120-2/simupak64-120-2.zip && \
unzip simupak64.zip && \
mv /simutrans-server-docker/serversave.sve /simutrans/save/
##Cleanup
RUN rm -rf /simutrans-server-docker && \
rm -rf /simutrans/music/ /simutrans/script/ && \
strip /simutrans/sim && \
apt-get -y remove autoconf build-essential git libbz2-dev libz-dev && \
apt -y autoremove
WORKDIR /simutrans
USER app
VOLUME ["/simutrans/pak/", "/simutrans/config/", "/simutrans/save/"]
ENTRYPOINT ["./sim", "-server","13353", "-singleuser", "-lang","en", "-objects","pak/", "-nosound", "-nomidi", "-noaddons", "-log","1", "-debug","3"]
CMD ["-load","serversave.sve"]