-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (32 loc) · 1.37 KB
/
Dockerfile
File metadata and controls
42 lines (32 loc) · 1.37 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
# Copyright (c) 2025 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
# ----------------------------------------
# Stage 1: gRPC Server Builder
# ----------------------------------------
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine3.22 AS builder
ARG TARGETARCH
RUN apk update && apk add --no-cache gcompat
# Set working directory.
WORKDIR /project
# Copy project file and restore dependencies.
COPY src/AccelByte.PluginArch.CloudsaveValidator.Demo.Server/*.csproj .
RUN ([ "$TARGETARCH" = "amd64" ] && echo "linux-musl-x64" || echo "linux-musl-$TARGETARCH") > /tmp/dotnet-rid
RUN dotnet restore -r $(cat /tmp/dotnet-rid)
# Copy application code.
COPY src/AccelByte.PluginArch.CloudsaveValidator.Demo.Server .
# Build and publish application.
RUN dotnet publish -c Release -r $(cat /tmp/dotnet-rid) --no-restore -o /build/
# ----------------------------------------
# Stage 2: Runtime Container
# ----------------------------------------
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine3.22
# Set working directory.
WORKDIR /app
# Copy server build from stage 1.
COPY --from=builder /build/ .
# Plugin Arch gRPC Server Port.
# Prometheus /metrics Web Server Port.
EXPOSE 6565
EXPOSE 8080
ENTRYPOINT [ "/app/AccelByte.PluginArch.CloudsaveValidator.Demo.Server" ]