-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDockerfile
36 lines (26 loc) · 904 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
# BUILD .NET CORE APP
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
# install node
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get install -y nodejs
# copy csproj and restore as distinct layers
WORKDIR /app
COPY . .
RUN dotnet restore
# publish
RUN dotnet publish -c Release -o dist
# PREPARE RUNTIME
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
# install utils
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales tzdata wget iputils-ping
# lang
ENV LANG=en_US.UTF-8
RUN locale-gen "en_US.UTF-8" && dpkg-reconfigure --frontend noninteractive locales
# timezone
RUN ln -fs /usr/share/zoneinfo/Europe/Moscow /etc/localtime && dpkg-reconfigure --frontend noninteractive tzdata
# prepare application
WORKDIR /system
COPY --from=build /app/dist ./
RUN rm -f appsettings.*.json
EXPOSE 8080
ENTRYPOINT ["dotnet","ThinkingHome.Console.dll"]