-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
Dockerfile
21 lines (18 loc) · 1.21 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
ENV TZ=Asia/Shanghai
RUN printf "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free\ndeb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free\ndeb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free\ndeb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free" > /etc/apt/sources.list
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt update && apt install -y procps && rm -rf /var/lib/apt/lists/*
WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS publish
WORKDIR /src
COPY . .
RUN sed -i -e 's/net6.0/net7.0/g' WFBot/WFBot.csproj
RUN dotnet restore "WFBot/WFBot.csproj" && rm -rf WFBot/wwwroot2 && mkdir WFBot/wwwroot2 && touch WFBot/wwwroot2/test
#WORKDIR "/src/WFBot"
RUN dotnet publish "WFBot" -c "Linux Release" -o /app/publish && rm -rf .git
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "WFBot.dll", "--", "--use-config-folder"]