-
Notifications
You must be signed in to change notification settings - Fork 39
/
Dockerfile
46 lines (39 loc) · 1014 Bytes
/
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
# Run a dotnet build container
FROM microsoft/dotnet:2.1-sdk as builder
WORKDIR /app
# Copy project source to builder
COPY . ./
# Restore Project Packages
RUN dotnet restore
# Enter the Server Project and build
RUN cd ServerHub && \
dotnet publish -f netcoreapp2.0 -o out -r linux-x64 && \
cd out && \
chmod +x ServerHub
FROM debian:stretch-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates netcat \
\
# .NET Core dependencies
libc6 \
libcurl3 \
libgcc1 \
libgssapi-krb5-2 \
libicu57 \
liblttng-ust0 \
libssl1.0.2 \
libstdc++6 \
libunwind8 \
libuuid1 \
zlib1g \
&& rm -rf /var/lib/apt/lists/*
# Enable detection of running in a container
ENV DOTNET_RUNNING_IN_CONTAINER=true
# Copy built files
WORKDIR /app
COPY --from=builder /app/ServerHub/out .
# Start the process
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=1 CMD nc -w 5 -uvz localhost 3700
EXPOSE 3700/udp
CMD ["./ServerHub"]