-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (23 loc) · 796 Bytes
/
Dockerfile
File metadata and controls
36 lines (23 loc) · 796 Bytes
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
ARG DOTNET_OS_VERSION="-alpine"
ARG DOTNET_SDK_VERSION=8.0
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_SDK_VERSION}${DOTNET_OS_VERSION} AS build-server
WORKDIR /src
COPY Server/*.csproj ./Server/
RUN dotnet restore ./Server/Server.csproj
COPY Server/. ./Server/
WORKDIR /src/Server
RUN dotnet publish -c Release -o /app/Server
FROM node:alpine AS build-client
WORKDIR /src/Client
COPY Client/package*.json ./
RUN npm install
COPY Client/. ./
RUN npm run build-prod
FROM mcr.microsoft.com/dotnet/aspnet:${DOTNET_SDK_VERSION}${DOTNET_OS_VERSION}
ENV ASPNETCORE_URLS http://+:8080
ENV ASPNETCORE_ENVIRONMENT Production
EXPOSE 8080
WORKDIR /app/Server
COPY --from=build-server /app/Server .
COPY --from=build-client /src/Client/dist /app/Server/wwwroot
ENTRYPOINT ["dotnet", "Server.dll"]