forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
90 lines (63 loc) · 2.17 KB
/
Dockerfile
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
FROM tgstation/byond:512.1441 as base
#above version must be the same as the one in dependencies.sh
FROM base as build_base
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
ca-certificates
FROM build_base as rust_g
WORKDIR /rust_g
RUN apt-get install -y --no-install-recommends \
libssl-dev \
rustc \
cargo \
pkg-config \
&& git init \
&& git remote add origin https://github.com/tgstation/rust-g
COPY dependencies.sh .
RUN /bin/bash -c "source dependencies.sh \
&& git fetch --depth 1 origin \$RUST_G_VERSION" \
&& git checkout FETCH_HEAD \
&& cargo build --release
FROM build_base as bsql
WORKDIR /bsql
RUN apt-get install -y --no-install-recommends software-properties-common \
&& add-apt-repository ppa:ubuntu-toolchain-r/test \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
cmake \
make \
g++-7 \
libmariadb-client-lgpl-dev \
&& git init \
&& git remote add origin https://github.com/tgstation/BSQL
COPY dependencies.sh .
RUN /bin/bash -c "source dependencies.sh \
&& git fetch --depth 1 origin \$BSQL_VERSION" \
&& git checkout FETCH_HEAD
WORKDIR /bsql/artifacts
ENV CC=gcc-7 CXX=g++-7
RUN ln -s /usr/include/mariadb /usr/include/mysql \
&& ln -s /usr/lib/i386-linux-gnu /root/MariaDB \
&& cmake .. \
&& make
FROM base as dm_base
WORKDIR /tgstation
FROM dm_base as build
COPY . .
RUN DreamMaker -max_errors 0 tgstation.dme && tools/deploy.sh /deploy
FROM dm_base
EXPOSE 1337
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
mariadb-client \
libssl1.0.0 \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /root/.byond/bin
COPY --from=rust_g /rust_g/target/release/librust_g.so /root/.byond/bin/rust_g
COPY --from=bsql /bsql/artifacts/src/BSQL/libBSQL.so ./
COPY --from=build /deploy ./
#bsql fexists memes
RUN ln -s /tgstation/libBSQL.so /root/.byond/bin/libBSQL.so
VOLUME [ "/tgstation/config", "/tgstation/data" ]
ENTRYPOINT [ "DreamDaemon", "tgstation.dmb", "-port", "1337", "-trusted", "-close", "-verbose" ]