forked from Black-Tek/BlackTek-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
64 lines (47 loc) · 1.39 KB
/
Dockerfile
File metadata and controls
64 lines (47 loc) · 1.39 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
FROM ubuntu:24.04 AS base
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
g++ \
make \
git \
curl \
zip \
unzip \
tar \
pkg-config \
uuid-dev \
wget \
ca-certificates \
python3 \
&& rm -rf /var/lib/apt/lists/*
# install premake5
FROM base AS premake
RUN git clone --depth 1 https://github.com/premake/premake-core.git /tmp/premake && \
cd /tmp/premake && make -f Bootstrap.mak linux && \
mv bin/release/premake5 /usr/local/bin/premake5
# install vcpkg and C++ libraries
FROM base AS dependencies
COPY --from=premake /usr/local/bin/premake5 /usr/local/bin/premake5
RUN git clone --depth 1 https://github.com/microsoft/vcpkg.git /opt/vcpkg && \
/opt/vcpkg/bootstrap-vcpkg.sh -disableMetrics
WORKDIR /build
COPY vcpkg.json premake5.lua ./
RUN /opt/vcpkg/vcpkg install --triplet x64-linux
# compile project
FROM dependencies AS build
COPY src/ ./src/
ARG BUILD_TYPE=release
RUN premake5 gmake2 && make -j$(nproc) config=${BUILD_TYPE}_64
FROM ubuntu:24.04
RUN apt-get update && apt-get install -y --no-install-recommends \
libstdc++6 \
libgcc-s1 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /build/Black-Tek-Server /bin/bts
COPY data /srv/data/
COPY README.md *.dist *.sql key.pem /srv/
EXPOSE 7171 7172
WORKDIR /srv
VOLUME /srv
ENTRYPOINT ["/bin/bts"]