-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Dockerfile
35 lines (27 loc) · 945 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
FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build-env
WORKDIR /App
# Add NPM
RUN apk add --update npm
# Copy everything
COPY . ./
# Restore as distinct layers
RUN dotnet restore samples/dymaptic.GeoBlazor.Core.Sample.Wasm/dymaptic.GeoBlazor.Core.Sample.Wasm.csproj
# Build and publish a release
RUN dotnet publish samples/dymaptic.GeoBlazor.Core.Sample.Wasm/dymaptic.GeoBlazor.Core.Sample.Wasm.csproj -c Release -o out
# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:7.0.3-alpine3.17
EXPOSE 5000
WORKDIR /App
COPY --from=build-env /App/out .
RUN ls -la
# Add Dumb-init
RUN apk upgrade -U -a \
&& apk add dumb-init \
&& rm -rf /var/cache/* \
&& mkdir /var/cache/apk \
&& mkdir /temp
# set up user
RUN addgroup -S geoblazor && adduser -S geoblazor -G geoblazor
RUN chmod -R 777 /temp
USER geoblazor
ENTRYPOINT ["dumb-init", "dotnet", "dymaptic.GeoBlazor.Core.Sample.Wasm.dll", "urls=http://0.0.0.0:5000/"]