forked from ScorpioStation/ScorpioStation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
84 lines (71 loc) · 2.4 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
FROM i386/debian:buster-slim as base
ENV BYOND_MAJOR=513
ENV BYOND_MINOR=1519
ENV BYOND_PORT=7777
EXPOSE $BYOND_PORT
#-------------------------------------------------------------------------------
# Install a MariaDB development package for a shared library we'll need later
#-------------------------------------------------------------------------------
FROM base as mariadb_library
#
# Install Debian packages
#
RUN apt-get update && apt-get install -y --no-install-recommends \
libmariadb-dev \
&& rm -rf /var/lib/apt/lists/*
#-------------------------------------------------------------------------------
# Build ScorpioStation from the DreamMaker code using BYOND
#-------------------------------------------------------------------------------
FROM base as byond_build
#
# Install Debian packages
#
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
make \
unzip \
&& rm -rf /var/lib/apt/lists/*
#
# Install BYOND
#
RUN curl "http://www.byond.com/download/build/${BYOND_MAJOR}/${BYOND_MAJOR}.${BYOND_MINOR}_byond_linux.zip" -o byond.zip \
&& unzip byond.zip \
&& cd /byond \
&& make here
ENV LD_LIBRARY_PATH="/byond/bin:${LD_LIBRARY_PATH}"
ENV PATH="/byond/bin:${PATH}"
#
# Build paradise.dme -> paradise.dmb, paradise.rsc
#
COPY . /scorpio
WORKDIR /scorpio
RUN DreamMaker paradise.dme
#-------------------------------------------------------------------------------
# Create the docker image for ScorpioStation
#-------------------------------------------------------------------------------
FROM base as scorpio_image
#
# Install OpenSSL dependency
#
RUN apt-get update && apt-get install -y --no-install-recommends \
openssl \
&& rm -rf /var/lib/apt/lists/*
#
# Copy things into the docker image
#
COPY . /scorpio
COPY --from=byond_build /byond /byond
COPY --from=byond_build /scorpio/paradise.dmb /scorpio/paradise.dmb
COPY --from=byond_build /scorpio/paradise.rsc /scorpio/paradise.rsc
COPY --from=rust-g:latest /rust-g/target/release/librust_g.so /scorpio/librust_g.so
COPY --from=mariadb_library /usr/lib/i386-linux-gnu/libmariadb.so /scorpio/libmariadb.so
#
# Configure the runtime environment for the docker image
#
ENV LD_LIBRARY_PATH="/scorpio:/byond/bin:${LD_LIBRARY_PATH}"
ENV PATH="/byond/bin:${PATH}"
WORKDIR /scorpio
#
# Define the command when the docker image is started
#
ENTRYPOINT DreamDaemon paradise.dmb -port $BYOND_PORT -trusted -close -verbose