-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
36 lines (29 loc) · 969 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
# Learn about building .NET container images:
# https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0.404-alpine3.20 AS build
ARG TARGETARCH
WORKDIR /source
COPY . .
RUN \
mv docker/pxwebapi/app.config PxWeb && \
mv docker/pxwebapi/log4net.config PxWeb && \
dotnet publish -a "$TARGETARCH" -o /app "PxWeb/PxWeb.csproj"
# Enable globalization and time zones:
# https://github.com/dotnet/dotnet-docker/blob/main/samples/enable-globalization.md
# final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:8.0.11-alpine3.20
EXPOSE 8080
ENV \
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
DOTNET_EnableDiagnostics=0 \
ASPNETCORE_HTTP_PORTS=8080 \
ASPNETCORE_ENVIRONMENT=Production
RUN apk add --no-cache \
icu-data-full \
icu-libs
WORKDIR /app
COPY --from=build /app .
USER $APP_UID
ENTRYPOINT [ "./PxWeb" ]