forked from GZTimeWalker/GZCTF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (24 loc) · 856 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 mcr.microsoft.com/dotnet/sdk:7.0 AS build
ARG TIMESTAMP
ARG GIT_SHA
ARG GIT_NAME
ENV VITE_APP_BUILD_TIMESTAMP=$TIMESTAMP
ENV VITE_APP_GIT_SHA=$GIT_SHA
ENV VITE_APP_GIT_NAME=$GIT_NAME
RUN apt update && \
apt install -y wget && \
apt install -y gnupg2 && \
wget -qO- https://deb.nodesource.com/setup_18.x | bash - && \
apt install -y build-essential nodejs
RUN npm i -g pnpm
COPY ["GZCTF", "/src/GZCTF/"]
WORKDIR "/src/GZCTF"
RUN dotnet restore "CTFServer.csproj"
RUN dotnet build "CTFServer.csproj" -c Release -o /app/build --no-restore
FROM build AS publish
RUN dotnet publish "CTFServer.csproj" -c Release -o /app/publish -r linux-x64 --no-self-contained /p:PublishReadyToRun=true
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS final
WORKDIR /app
EXPOSE 80
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "CTFServer.dll"]