-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
32 lines (26 loc) · 903 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
FROM --platform=$BUILDPLATFORM alpine:3.19 AS base
RUN apk update && apk upgrade
RUN apk add --no-cache icu-libs
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
WORKDIR /app
RUN adduser -u 1000 --disabled-password --gecos "" appuser && chown -R appuser /app
USER appuser
EXPOSE 80
EXPOSE 443
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine3.19 AS build
RUN apk update && apk upgrade
RUN apk add --no-cache clang build-base zlib-dev
WORKDIR /src
FROM --platform=$BUILDPLATFORM build AS publish
COPY . .
ARG RUNTIME_ID=x64
RUN dotnet publish "./src/SlimFaas/SlimFaas.csproj" -c Release -a $RUNTIME_ID -o /app/publish
RUN ls -la /app/publish
RUN rm /app/publish/*.pdb
RUN rm /app/publish/*.dbg
RUN rm /app/publish/SlimData
FROM --platform=$BUILDPLATFORM base AS final
WORKDIR /app
COPY --chown=appuser --from=publish /app/publish .
RUN ls -la
ENTRYPOINT ["./SlimFaas"]