forked from ACEmulator/ACE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.arm64
47 lines (39 loc) · 1.49 KB
/
Dockerfile.arm64
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
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /Source
# copy csproj and restore as distinct layers
COPY ./Source/*.sln ./
COPY ./Source/ACE.Adapter/*.csproj ./ACE.Adapter/
COPY ./Source/ACE.Common/*.csproj ./ACE.Common/
COPY ./Source/ACE.Database/*.csproj ./ACE.Database/
COPY ./Source/ACE.Database.Tests/*.csproj ./ACE.Database.Tests/
COPY ./Source/ACE.DatLoader/*.csproj ./ACE.DatLoader/
COPY ./Source/ACE.DatLoader.Tests/*.csproj ./ACE.DatLoader.Tests/
COPY ./Source/ACE.Entity/*.csproj ./ACE.Entity/
COPY ./Source/ACE.Server/*.csproj ./ACE.Server/
COPY ./Source/ACE.Server.Tests/*.csproj ./ACE.Server.Tests/
RUN dotnet restore -r linux-arm64
# copy and publish app and libraries
COPY . ../.
RUN dotnet publish ./ACE.Server/ACE.Server.csproj -c release -o /ace -r linux-arm64 --self-contained false --no-restore
# final stage/image
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim-arm64v8
ARG DEBIAN_FRONTEND="noninteractive"
WORKDIR /ace
# install net-tools (netstat for health check) & cleanup
RUN apt-get update && \
apt-get install -y \
net-tools && \
apt-get clean && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# add app from build
COPY --from=build /ace .
ENTRYPOINT ["dotnet", "./ACE.Server.dll"]
# ports and volumes
EXPOSE 9000-9001/udp
VOLUME /ace/Config /ace/Content /ace/Dats /ace/Logs
# health check
HEALTHCHECK --start-period=5m --interval=1m --timeout=3s \
CMD netstat -an | grep 9000 > /dev/null; if [ 0 != $? ]; then exit 1; fi;