-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
73 lines (56 loc) · 1.74 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
#
# MonaServer2 Dockerfile
FROM alpine:latest AS builder
LABEL maintainer="Thomas Jammet <contact@monaserver.ovh>"
ENV LUAJIT_VERSION 2.1.0-beta3
ENV LUAJIT_DOWNLOAD_SHA256 1ad2e34b111c802f9d0cdf019e986909123237a28c746b21295b63c9e785d9c3
# install prerequisites
RUN apk add --no-cache libgcc \
libstdc++ \
openssl-dev
RUN apk add --no-cache --virtual .build-deps \
curl \
make \
g++ \
git
# Build & install luajit
WORKDIR /usr/src
RUN curl -fSL -o luajit.tar.gz http://luajit.org/download/LuaJIT-$LUAJIT_VERSION.tar.gz \
&& echo "$LUAJIT_DOWNLOAD_SHA256 *luajit.tar.gz" | sha256sum -c \
&& tar -xzf luajit.tar.gz \
&& cd LuaJIT-$LUAJIT_VERSION \
&& sed -i 's/#XCFLAGS+= -DLUAJIT_ENABLE_LUA52COMPAT/XCFLAGS+= -DLUAJIT_ENABLE_LUA52COMPAT/g' src/Makefile \
&& make \
&& make install
# Build
RUN git clone https://github.com/MonaSolutions/MonaServer2.git
WORKDIR /usr/src/MonaServer2/MonaBase
RUN make
WORKDIR /usr/src/MonaServer2/MonaCore
RUN make
WORKDIR /usr/src/MonaServer2/MonaServer
RUN make
# install MonaServer
RUN cp ../MonaBase/lib/libMonaBase.so ../MonaCore/lib/libMonaCore.so /usr/local/lib \
&& cp MonaServer ../MonaTiny/cert.pem ../MonaTiny/key.pem /usr/local/bin
# No need to delete build tools with the multi-stage build
##################################################
# Create a new Docker image with just the binaries
FROM alpine:latest
RUN apk add --no-cache libgcc libstdc++
COPY --from=builder /usr/local/lib /usr/local/lib
COPY --from=builder /usr/local/bin /usr/local/bin
#
# Expose ports for MonaCore protocols
#
# HTTP(S)/WS(S)
EXPOSE 80/tcp
EXPOSE 443/tcp
# RTM(F)P
EXPOSE 1935/tcp
EXPOSE 1935/udp
# STUN
EXPOSE 3478/udp
WORKDIR /usr/local/bin
# Set MonaServer as default executable
CMD ["./MonaServer", "--log=7"]